@cryptotaxi247 / netdata-1 / commits / 23da557d1

Netdata not returning correct value for unknow variables (#6984)

* health_nan: fix result The expression evaluate was keeping the value zero when there was a wrong variable, but according our documentation the correct result would be NAN, this commit fixes this * health_nan: mapping * health_nan: Set variable After few tests, I am setting the NAN value to the variable in the correct place

thiagoftsm committed Oct 21, 2019 at 11:59 UTC 23da557d13913e7dae3fdf4461309876b4b80581
1 file changed +1 -1
libnetdata/eval/eval.c
+1 -1
@@ -176,7 +176,7 @@ static inline calculated_number eval_variable(EVAL_EXPRESSION *exp, EVAL_VARIABL
176
177 *error = EVAL_ERROR_UNKNOWN_VARIABLE;
178 buffer_sprintf(exp->error_msg, "[ undefined variable '%s' ] ", v->name);
179 - return 0;
179 + return NAN;
180 }
181
182 static inline calculated_number eval_value(EVAL_EXPRESSION *exp, EVAL_VALUE *v, int *error) {