From: Tobias Oetiker Date: Sat, 10 Nov 2012 16:48:16 +0000 (+0100) Subject: fix trendnan variable access X-Git-Tag: v1.5.0-rc1~207 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2bd81b2dada49475f05762fdc9b06c030552d8f;p=thirdparty%2Frrdtool-1.x.git fix trendnan variable access --- diff --git a/src/rrd_rpncalc.c b/src/rrd_rpncalc.c index ab01c8ad..1e76ee5d 100644 --- a/src/rrd_rpncalc.c +++ b/src/rrd_rpncalc.c @@ -887,7 +887,9 @@ short rpn_calc( if (output_idx + 1 >= (int) ceil((float) dur / (float) step)) { int ignorenan = (rpnp[rpi].op == OP_TREND); double accum = 0.0; - int i = 0; + int i = -1; /* pick the current entries, not the next one + as the data pointer has already been forwarded + when the OP_VARIABLE was processed */ int count = 0; do {