diff --git a/src/rrd_rpncalc.c b/src/rrd_rpncalc.c
index b3d776014db408b149101d6511e2e460a0fda72f..630a94c49c7148ce17a3738a1eee3ebb11fef851 100644 (file)
--- a/src/rrd_rpncalc.c
+++ b/src/rrd_rpncalc.c
/****************************************************************************
- * RRDtool 1.4.7 Copyright by Tobi Oetiker, 1997-2012
+ * RRDtool 1.4.8 Copyright by Tobi Oetiker, 1997-2013
****************************************************************************
* rrd_rpncalc.c RPN calculator functions
****************************************************************************/
rpnp[steps].op = VV; \
rpnp[steps].ptr = (*lookup)(key_hash,vname); \
if (rpnp[steps].ptr < 0) { \
+ rrd_set_error("variable '%s' not found",vname);\
free(rpnp); \
return NULL; \
} else expr+=length; \
}
else {
+ rrd_set_error("don't undestand '%s'",expr);
setlocale(LC_NUMERIC, old_locale);
free(rpnp);
return NULL;
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 {