From f09a166925767192da1ab3729e2119e582a54006 Mon Sep 17 00:00:00 2001 From: oetiker Date: Tue, 22 Nov 2011 12:59:57 +0000 Subject: [PATCH] the first TREND* value can be calculated earlier ... -- fredrick (fix for #312) git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.4@2210 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_rpncalc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/rrd_rpncalc.c b/program/src/rrd_rpncalc.c index 4cb177dd..25f52841 100644 --- a/program/src/rrd_rpncalc.c +++ b/program/src/rrd_rpncalc.c @@ -881,7 +881,7 @@ short rpn_calc( time_t dur = (time_t) rpnstack->s[stptr]; time_t step = (time_t) rpnp[rpi - 2].step; - if (output_idx > (int) ceil((float) dur / (float) step)) { + if (output_idx + 1 >= (int) ceil((float) dur / (float) step)) { int ignorenan = (rpnp[rpi].op == OP_TREND); double accum = 0.0; int i = 0; -- 2.30.2