X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_graph.c;h=a29e47d64e1524f67bf29494b83f20deff8c4bdc;hb=3c3effad5f54f8c73260068e3ec32c56684243bb;hp=ea5d8c3b2be2715c9baa77a07f019c696d04103c;hpb=a12627275ff8487174cbb907a066f62a00b6ae44;p=rrdtool.git diff --git a/src/rrd_graph.c b/src/rrd_graph.c index ea5d8c3..a29e47d 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -938,7 +938,7 @@ long find_var( return -1; } -/* find the largest common denominator for all the numbers +/* find the greatest common divisor for all the numbers in the 0 terminated num array */ long lcd( long *num) @@ -4523,21 +4523,16 @@ 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; - end = - src->end_orig % (long) src->step == - 0 ? src->end_orig : (src->end_orig + (long) src->step - - src->end_orig % (long) src->step); - steps = (end - src->start) / src->step; + steps = (src->end - src->start) / src->step; #if 0 printf ("DEBUG: start == %lu, end == %lu, %lu steps\n", - src->start, src->end_orig, steps); + src->start, src->end, steps); #endif switch (dst->vf.op) { case VDEF_PERCENT:{