]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Fixed overflow bug.
authorNick <nick@example.com>
Sat, 9 Feb 2013 16:38:17 +0000 (16:38 +0000)
committerTobias Oetiker <tobi@oetiker.ch>
Sun, 10 Feb 2013 11:24:31 +0000 (12:24 +0100)
src/rrd_fetch.c

index c6975b250f594fc0a6bb7c1703b0ce54f2079629..267fd952cb1e4860577eb10d2fbc2e6e9c7e9519 100644 (file)
@@ -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",