From: Mariusz Szafranski Date: Thu, 1 Mar 2018 12:07:56 +0000 (+0000) Subject: ipmi plugin: Fix crash in ipmi.so (interval < 0.5) X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=94e53011cbe27743da2d9d4a8d3e0fa18fd2a931;p=collectd.git ipmi plugin: Fix crash in ipmi.so (interval < 0.5) Fixes crash (divide by 0) in ipmi.so when plugin related interval set to 0.45 or less. Change-Id: I3ac2282efdc005edefe92f870ac30417451c202c Signed-off-by: Mariusz Szafranski --- diff --git a/src/ipmi.c b/src/ipmi.c index 2db344e6..b1109208 100644 --- a/src/ipmi.c +++ b/src/ipmi.c @@ -1210,7 +1210,7 @@ static int c_ipmi_init(void) { } /* Don't send `ADD' notifications during startup (~ 1 minute) */ - int cycles = 1 + (60 / CDTIME_T_TO_TIME_T(plugin_get_interval())); + int cycles = 1 + (int)(TIME_T_TO_CDTIME_T(60) / plugin_get_interval()); st = instances; while (NULL != st) {