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
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)