]> 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)
committerNick <nick@example.com>
Sat, 9 Feb 2013 16:38:17 +0000 (16:38 +0000)
src/rrd_fetch.c

index 47b41669fd25a390bbc2385b5e91663f6c1231de..e88580cfe5852ec1482a7e76c81aad14c033c8d0 100644 (file)
@@ -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",