fix stak+nan error ... Scott Mace <smace@intt.ORG>
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Thu, 30 Jan 2003 21:39:21 +0000 (21:39 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Thu, 30 Jan 2003 21:39:21 +0000 (21:39 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@175 a5681a0c-68f1-0310-ab6d-d61299d08faa

src/rrd_graph.c

index 5060733..9e9cd8f 100644 (file)
@@ -2399,14 +2399,11 @@ graph_paint(image_desc_t *im, char ***calcpr)
       /* make sure we do not run into trouble when stacking on NaN */
       for(ii=0;ii<im->xsize;ii++){
         if (isnan(im->gdes[i].p_data[ii])) {
-          double ybase = 0.0;
           if (lastgdes) {
-            ybase = ytr(im,lastgdes->p_data[ii-1]);
-          };
-          if (isnan(ybase) || !lastgdes ){
-            ybase =  ytr(im,areazero);
+            im->gdes[i].p_data[ii] = lastgdes->p_data[ii];
+          } else {
+            im->gdes[i].p_data[ii] =  ytr(im,areazero);
           }
-          im->gdes[i].p_data[ii] = ybase;
         }
       } 
       lastgdes = &(im->gdes[i]);