X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=program%2Fsrc%2Frrd_fetch.c;h=bc1557d985215863cef02e8a13feabda80f55aa8;hb=1de89384aaa455c16be1839abfe3f7ee4ec3af95;hp=9ef0405bdc222d78c6fafc222dea5e44feebb56e;hpb=fdb03faa2f532a91bdd02a9c02c4a9c130f434a2;p=rrdtool-all.git diff --git a/program/src/rrd_fetch.c b/program/src/rrd_fetch.c index 9ef0405b..bc1557d9 100644 --- a/program/src/rrd_fetch.c +++ b/program/src/rrd_fetch.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.2.2 Copyright by Tobi Oetiker, 1997-2005 + * RRDtool 1.2.12 Copyright by Tobi Oetiker, 1997-2005 ***************************************************************************** * rrd_fetch.c read date from an rrd to use for further processing ***************************************************************************** @@ -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",