From: oetiker Date: Sun, 28 Sep 2008 15:01:43 +0000 (+0000) Subject: vdef calc was using end_orig to determine for which range it should do its X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ca40fee8cbd13a8d9a1961a1db53bc8e0e77ff81;p=rrdtool-all.git vdef calc was using end_orig to determine for which range it should do its calculations which is odd, since orig is only the requested range as invocation time and not the data range deliverd by fetch. It does fall completely flat when shifting since shifting does not affect the original data. Bug #177 reported by hokiel git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@1530 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/src/rrd_graph.c b/program/src/rrd_graph.c index 350a8dac..6125c8a0 100644 --- a/program/src/rrd_graph.c +++ b/program/src/rrd_graph.c @@ -3508,7 +3508,7 @@ rrd_graph_options(int argc, char *argv[],image_desc_t *im) if (size > 0){ im->text_prop[propidx].size=size; } - if (strlen(optarg) > end){ + if ((int)strlen(optarg) > end){ if (optarg[end] == ':'){ strncpy(im->text_prop[propidx].font,optarg+end+1,255); im->text_prop[propidx].font[255] = '\0'; @@ -3791,17 +3791,16 @@ int gdi; { graph_desc_t *src,*dst; rrd_value_t *data; - long step,steps,end; + long step,steps; dst = &im->gdes[gdi]; src = &im->gdes[dst->vidx]; data = src->data + src->ds; - 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; + steps = (src->end - src->start) / src->step; #if 0 printf("DEBUG: start == %lu, end == %lu, %lu steps\n" ,src->start - ,src->end_orig + ,src->end ,steps ); #endif