Code

Fixed a bug with WriteQueueLengthLimitHigh is null/uninitialized
[collectd.git] / src / plugin.c
index 4f1f6e16d504b59554026dd6531259d07b85d8a9..0aee64667d200651b548573bb30138e5c04fb8bb 100644 (file)
@@ -1449,7 +1449,7 @@ void plugin_init_all (void)
        post_cache_chain = fc_chain_get_by_name (chain_name);
 
        write_limit_high = global_option_get_long_in_range("WriteQueueLengthLimitHigh",0, 0, LONG_MAX);
-       write_limit_low = global_option_get_long_in_range("WriteQueueLengthLimitLow", (write_limit_high+1)/2, 0, write_limit_high-1 );
+       write_limit_low = global_option_get_long_in_range("WriteQueueLengthLimitLow", (write_limit_high+1)/2, 0, (write_limit_high == 0) ? 0 : write_limit_high-1 );
 
        {
                char const *tmp = global_option_get ("WriteThreads");