From: Yves Mettier Date: Fri, 26 Apr 2013 09:50:18 +0000 (+0200) Subject: Fixed a bug with WriteQueueLengthLimitHigh is null/uninitialized X-Git-Tag: collectd-5.4.0~21^2~2 X-Git-Url: https://git.tokkee.org/?p=collectd.git;a=commitdiff_plain;h=4088bccc40644f45971304f4c73bc40dcfb87957 Fixed a bug with WriteQueueLengthLimitHigh is null/uninitialized Signed-off-by: Florian Forster --- diff --git a/src/configfile.c b/src/configfile.c index 193e05d2..044180ee 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -936,7 +936,7 @@ long global_option_get_long_in_range (const char *option, long default_value, lo { long value; - assert(min < max); + assert(min <= max); value = global_option_get_long(option, default_value); if(value < min) return(default_value); if(value > max) return(default_value); diff --git a/src/plugin.c b/src/plugin.c index 4f1f6e16..0aee6466 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -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");