From 14eca7ff5e5f63e50274a2dc712b43f36d06d18e Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 9 Feb 2013 16:38:17 +0000 Subject: [PATCH] Fixed overflow bug. --- src/rrd_fetch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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", -- 2.47.2