From: petgit Date: Sun, 13 Jul 2014 14:24:13 +0000 (+0200) Subject: Create rrd file: Allow only short integer numbers in rpn formula X-Git-Tag: v1.5.0-rc1~62^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F517%2Fhead;p=thirdparty%2Frrdtool-1.x.git Create rrd file: Allow only short integer numbers in rpn formula --- diff --git a/src/rrd_rpncalc.c b/src/rrd_rpncalc.c index b342ec24..bf87e6a8 100644 --- a/src/rrd_rpncalc.c +++ b/src/rrd_rpncalc.c @@ -47,7 +47,7 @@ short rpn_compact( /* rpnp.val is a double, rpnc.val is a short */ double temp = floor(rpnp[i].val); - if (temp < SHRT_MIN || temp > SHRT_MAX) { + if (temp < SHRT_MIN || temp > SHRT_MAX || temp != rpnp[i].val) { rrd_set_error ("constants must be integers in the interval (%d, %d)", SHRT_MIN, SHRT_MAX);