X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=inline;f=src%2Frrd_graph.c;h=db9a8c70b724722304582431abd553a944d3179b;hb=daf8e7ff715a59e1f9827080d1b785ffb3c5a4b1;hp=480041f9f8d89a117a5c8f65831ddfcfd39fb82b;hpb=3c268443bb768669f3bd095b9e95a9a5ab4c5ef2;p=rrdtool.git diff --git a/src/rrd_graph.c b/src/rrd_graph.c index 480041f..db9a8c7 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.3rc6 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3rc7 Copyright by Tobi Oetiker, 1997-2008 **************************************************************************** * rrd__graph.c produce graphs from data in rrdfiles ****************************************************************************/ @@ -4510,15 +4510,18 @@ int vdef_calc( graph_desc_t *src, *dst; rrd_value_t *data; long step, steps; + unsigned long 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, steps); + src->start, src->end_orig, steps); #endif switch (dst->vf.op) { case VDEF_PERCENT:{