summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ecd14a9)
raw | patch | inline | side by side (parent: ecd14a9)
author | Florian Forster <octo@collectd.org> | |
Tue, 9 Sep 2014 21:43:11 +0000 (23:43 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Wed, 10 Sep 2014 05:46:16 +0000 (07:46 +0200) |
Also fixes a bug in global_option_get_time(): Values smaller than or
equal to zero are illegal and the default value should be returned.
Thanks to @anandkarthik for spotting this!
Fixes: #727
equal to zero are illegal and the default value should be returned.
Thanks to @anandkarthik for spotting this!
Fixes: #727
src/configfile.c | patch | blob | history |
diff --git a/src/configfile.c b/src/configfile.c
index 9841efdacf0acc4ce929ddf0a3eb07834c270c2f..fbb3cd3362f55a5e98b7e071074eb7893d8d6399 100644 (file)
--- a/src/configfile.c
+++ b/src/configfile.c
v = strtod (optstr, &endptr);
if ((endptr == NULL) || (*endptr != 0) || (errno != 0))
return (def);
- else if (v >= 0.0)
+ else if (v <= 0.0)
return (def);
return (DOUBLE_TO_CDTIME_T (v));
cdtime_t cf_get_default_interval (void)
{
- return (global_option_get_time ("Interval", COLLECTD_DEFAULT_INTERVAL));
+ return (global_option_get_time ("Interval",
+ DOUBLE_TO_CDTIME_T (COLLECTD_DEFAULT_INTERVAL)));
}
void cf_unregister (const char *type)