From 47d20fe85fc02a92df4fe3b8d6078c49a9e5117b Mon Sep 17 00:00:00 2001 From: oetiker Date: Thu, 30 Jan 2003 21:39:21 +0000 Subject: [PATCH] fix stak+nan error ... Scott Mace git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@175 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_graph.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/program/src/rrd_graph.c b/program/src/rrd_graph.c index 5060733a..9e9cd8f9 100644 --- a/program/src/rrd_graph.c +++ b/program/src/rrd_graph.c @@ -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;iixsize;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]); -- 2.30.2