From: Nick Date: Sat, 9 Feb 2013 16:38:17 +0000 (+0000) Subject: Fixed overflow bug. X-Git-Tag: v1.5.0-rc1~196^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bedd69a6452b5d9ea66c0d327660992c1b92e048;p=thirdparty%2Frrdtool-1.x.git Fixed overflow bug. --- diff --git a/src/rrd_fetch.c b/src/rrd_fetch.c index 47b41669..e88580cf 100644 --- a/src/rrd_fetch.c +++ b/src/rrd_fetch.c @@ -404,8 +404,8 @@ int rrd_fetch_fn( rra_start_time = (rra_end_time - (*step * (rrd.rra_def[chosen_rra].row_cnt - 1))); /* here's an error by one if we don't be careful */ - start_offset = (long) (*start + *step - rra_start_time) / (long) *step; - end_offset = (long) (rra_end_time - *end) / (long) *step; + start_offset = ((long) *start + *step - rra_start_time) / (long) *step; + end_offset = ((long) rra_end_time - *end) / (long) *step; #ifdef DEBUG fprintf(stderr, "rra_start %lu, rra_end %lu, start_off %li, end_off %li\n",