Fix read of uninitialized memory (#2596)

Previous code was reading whole array, it was slower and it
read uninitialized memory
This commit is contained in:
Zbyněk Moravec 2016-12-02 18:53:59 +01:00 committed by Michael Stapelberg
parent d7dcef61d7
commit 05a2270eb7
1 changed files with 1 additions and 1 deletions

View File

@ -981,7 +981,7 @@ int *bindings_get_buttons_to_grab(void) {
} }
/* Avoid duplicates. */ /* Avoid duplicates. */
for (int i = 0; i < num_max; i++) { for (int i = 0; i < num; i++) {
if (buffer[i] == button) if (buffer[i] == button)
continue; continue;
} }