summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b08257d)
raw | patch | inline | side by side (parent: b08257d)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 18 Sep 2005 16:59:34 +0000 (16:59 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 18 Sep 2005 16:59:34 +0000 (16:59 +0000) |
program/src/rrd_fetch.c | patch | blob | history |
index 9bcaeb18f6978a0653019e401aed7528bed9f57c..e6590ec74c98dab7388486ba536903523d4c9669 100644 (file)
--- a/program/src/rrd_fetch.c
+++ b/program/src/rrd_fetch.c
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)
*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",