From: oetiker Date: Tue, 22 Nov 2011 12:59:57 +0000 (+0000) Subject: the first TREND* value can be calculated earlier ... -- fredrick (fix for #312) X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=327c6498066d67dd7b343b2c677c2e7fe1fb7d98;p=rrdtool.git the first TREND* value can be calculated earlier ... -- fredrick (fix for #312) git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@2210 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_rpncalc.c b/src/rrd_rpncalc.c index c1a61c2..8dd2240 100644 --- a/src/rrd_rpncalc.c +++ b/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;