X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Frrd_fetch.c;h=e6590ec74c98dab7388486ba536903523d4c9669;hb=be67fb36af7b40e2cb388a4d8a1f3cc0bdba90b2;hp=9bcaeb18f6978a0653019e401aed7528bed9f57c;hpb=8b72aa265bde592af7e13220a3484c5657d6ffaf;p=rrdtool.git diff --git a/src/rrd_fetch.c b/src/rrd_fetch.c index 9bcaeb1..e6590ec 100644 --- a/src/rrd_fetch.c +++ b/src/rrd_fetch.c @@ -182,12 +182,12 @@ rrd_fetch_fn( int first_part = 1; rrd_t rrd; rrd_value_t *data_ptr; - unsigned long rows = (*end - *start) / *step; + unsigned long rows; #ifdef DEBUG fprintf(stderr,"Entered rrd_fetch_fn() searching for the best match\n"); -fprintf(stderr,"Looking for: start %10lu end %10lu step %5lu rows %lu\n", - *start,*end,*step,rows); +fprintf(stderr,"Looking for: start %10lu end %10lu step %5lu\n", + *start,*end,*step); #endif if(rrd_open(filename,&in_file,&rrd, RRD_READONLY)==-1) @@ -295,7 +295,7 @@ fprintf(stderr,"partial match, not best\n"); *step = rrd.stat_head->pdp_step * rrd.rra_def[chosen_rra].pdp_cnt; *start -= (*start % *step); if (*end % *step) *end += (*step - *end % *step); - rows = (*end - *start) / *step; + rows = (*end - *start) / *step + 1; #ifdef DEBUG fprintf(stderr,"We found: start %10lu end %10lu step %5lu rows %lu\n",