summary refs log tree commit diff
path: root/src/main.c
diff options
context:
space:
mode:
authorzlago2024-12-26 00:07:12 +0100
committerzlago2024-12-26 00:07:12 +0100
commit93ccfeeb9032eec91e0a4e5053f6646a5c73fe2d (patch)
tree1dc3fe57f13ea95e16d636354090fffeb7c6c24a /src/main.c
parentf7e4de7c45ed848312690ce6cfb62ae562e8347c (diff)
bugfixes
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c6
1 files changed, 4 insertions, 2 deletions
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;