From ca6d70566c339eb24aca8af29f8000008e53184a Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Mon, 30 Oct 2017 07:59:47 +0100 Subject: Fixup displaying measurements (array overflow) --- src/common/display_measurements.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/display_measurements.c b/src/common/display_measurements.c index 103384d..028224a 100644 --- a/src/common/display_measurements.c +++ b/src/common/display_measurements.c @@ -143,9 +143,9 @@ static void print_measurements(int on) break; } /* add current value to history */ - param->value_history[param->value_history_pos++] = value; - param->value2_history[param->value_history_pos++] = value2; - param->value_history_pos %= DISPLAY_PARAM_HISTORIES; + param->value_history[param->value_history_pos] = value; + param->value2_history[param->value_history_pos] = value2; + param->value_history_pos = param->value_history_pos % DISPLAY_PARAM_HISTORIES; /* calculate hold values */ hold = -NAN; hold2 = -NAN; -- cgit v1.2.3