From: Nick Date: Sat, 9 Feb 2013 16:38:17 +0000 (+0000) Subject: Fixed overflow bug. X-Git-Tag: 1.4.8~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14eca7ff5e5f63e50274a2dc712b43f36d06d18e;p=thirdparty%2Frrdtool-1.x.git Fixed overflow bug. --- diff --git a/src/rrd_fetch.c b/src/rrd_fetch.c index c6975b25..267fd952 100644 --- a/src/rrd_fetch.c +++ b/src/rrd_fetch.c @@ -374,8 +374,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",