X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_rpncalc.c;h=8dd224000824adcd496a636de3dde210c81123ed;hb=327c6498066d67dd7b343b2c677c2e7fe1fb7d98;hp=c1a61c205adb8cb5693654df19eacb368e1a4770;hpb=e99b152422682f6bf2b501c75f32d4584a60249c;p=rrdtool.git 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;