From 93ccfeeb9032eec91e0a4e5053f6646a5c73fe2d Mon Sep 17 00:00:00 2001 From: zlago Date: Thu, 26 Dec 2024 00:07:12 +0100 Subject: bugfixes --- src/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 9c40876..f86ed0b 100644 --- a/src/main.c +++ b/src/main.c @@ -535,8 +535,10 @@ void main_loop(void) { size_t const start = touch.allocated; touch.allocated = i + 1; touch.positions = realloc(touch.positions, sizeof (struct touch_vec) * touch.allocated); - for (size_t index = start; index < i - 1; index++) { - touch.positions[index].active = 0; + if (i) { // hack for 0 - 1 = absurd-high number; all of RAM gets wiped + for (size_t index = start; index < i - 1; index++) { + touch.positions[index].active = 0; + } } } touch.positions[i].active = 1; -- cgit 1.4.1-2-gfad0