From: Eduardo Bragatto Date: Tue, 18 Nov 2014 08:30:03 +0000 (-0200) Subject: Fixed overflow boundary for 32 bit counters X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cecba3f97fedbe2d69a302357ce25f61e2a881b0;p=thirdparty%2Frrdtool-1.x.git Fixed overflow boundary for 32 bit counters --- diff --git a/src/rrd_update.c b/src/rrd_update.c index 9516cf7d..741e69dd 100644 --- a/src/rrd_update.c +++ b/src/rrd_update.c @@ -1072,7 +1072,7 @@ static int update_pdp_prep( * ... are there any others in SNMP land? */ if (pdp_new[ds_idx] < (double) 0.0) - pdp_new[ds_idx] += (double) 4294967296.0; /* 2^32 */ + pdp_new[ds_idx] += (double) 4294967295.0; /* 2^32 - 1 */ if (pdp_new[ds_idx] < (double) 0.0) pdp_new[ds_idx] += (double) 18446744069414584320.0; /* 2^64-2^32 */ }