Code

vdef calc was using end_orig to determine for which range it should do its
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sun, 28 Sep 2008 15:01:43 +0000 (15:01 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sun, 28 Sep 2008 15:01:43 +0000 (15:01 +0000)
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

program/src/rrd_graph.c

index 350a8dac5cb830aa066280c17b4fdef5f84d9308..6125c8a0b279b22d4a59377eba4c2a8ebaffcba7 100644 (file)
@@ -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