]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Use the correct size for the modifiers (Thanks Moredread!)
authorMichael Stapelberg <michael@stapelberg.de>
Thu, 11 Jun 2009 01:30:56 +0000 (03:30 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Thu, 11 Jun 2009 01:30:56 +0000 (03:30 +0200)
src/xcb.c

index cefb9c33accb7639f733fa1dd4c06cc82d2e3022..db38a7bb2e8cc07cce060ebfe72a81cf48b74ebd 100644 (file)
--- a/src/xcb.c
+++ b/src/xcb.c
@@ -267,10 +267,11 @@ void xcb_get_numlock_mask(xcb_connection_t *conn) {
         /* For now, we only use the first keysymbol. */
         xcb_keycode_t *numlock_syms = xcb_key_symbols_get_keycode(keysyms, XCB_NUM_LOCK);
         xcb_keycode_t numlock = *numlock_syms;
+        free(numlock_syms);
 #endif
 
         /* Check all modifiers (Mod1-Mod5, Shift, Control, Lock) */
-        for (mask = 0; mask < sizeof(masks); mask++)
+        for (mask = 0; mask < 8; mask++)
                 for (i = 0; i < reply->keycodes_per_modifier; i++)
                         if (modmap[(mask * reply->keycodes_per_modifier) + i] == numlock)
                                 xcb_numlock_mask = masks[mask];