Code

make sure vdef calcs only calc as far as originally requested.
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sat, 31 May 2008 12:28:11 +0000 (12:28 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sat, 31 May 2008 12:28:11 +0000 (12:28 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@1386 a5681a0c-68f1-0310-ab6d-d61299d08faa

src/rrd_graph.c

index deb23cf4723fc017671321f39c24e3d3fff46bfc..3ee158254aec58c97e5890322d03fd2a9b92b2e4 100644 (file)
@@ -3789,17 +3789,17 @@ int gdi;
 {
     graph_desc_t        *src,*dst;
     rrd_value_t                *data;
-    long                step,steps;
+    long                step,steps,end;
 
     dst = &im->gdes[gdi];
     src = &im->gdes[dst->vidx];
     data = src->data + src->ds;
-    steps = (src->end - src->start) / src->step;
-
+    end = (src->end_orig % src->step) == 0 ? src->end_orig : (src->end_orig + src->step - src->end_orig % src->step);
+    steps = (end - src->start) / src->step;
 #if 0
 printf("DEBUG: start == %lu, end == %lu, %lu steps\n"
     ,src->start
-    ,src->end
+    ,src->end_orig
     ,steps
     );
 #endif