aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2017-10-30 07:59:47 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2017-11-05 16:59:59 +0100
commitca6d70566c339eb24aca8af29f8000008e53184a (patch)
tree459ede62634172ea45668e0e5f74659c26543487
parente8a3306eee9eadd8d8d2547ed4e6c012a155109b (diff)
Fixup displaying measurements (array overflow)
-rw-r--r--src/common/display_measurements.c6
1 files 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;