From 05a2270eb7aff19b060ebac7830a29c5278b7cc6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbyn=C4=9Bk=20Moravec?= Date: Fri, 2 Dec 2016 18:53:59 +0100 Subject: [PATCH] Fix read of uninitialized memory (#2596) Previous code was reading whole array, it was slower and it read uninitialized memory --- src/bindings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings.c b/src/bindings.c index eec821b6..c76e7779 100644 --- a/src/bindings.c +++ b/src/bindings.c @@ -981,7 +981,7 @@ int *bindings_get_buttons_to_grab(void) { } /* Avoid duplicates. */ - for (int i = 0; i < num_max; i++) { + for (int i = 0; i < num; i++) { if (buffer[i] == button) continue; } -- 2.39.5