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.4.9~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98a11d7f81c8f15ab85d0591a44cd27482f4f511;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 0920fce3..a96c588c 100644 --- a/src/rrd_rpncalc.c +++ b/src/rrd_rpncalc.c @@ -46,7 +46,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);