From 6e5406167c85b86f6e4a45f3fa0c0ced85dcd0e8 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 11 Jun 2009 03:30:56 +0200 Subject: [PATCH] Bugfix: Use the correct size for the modifiers (Thanks Moredread!) --- src/xcb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xcb.c b/src/xcb.c index cefb9c33..db38a7bb 100644 --- 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];