diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/input.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/input.c b/src/input.c index b069991..ab52931 100644 --- a/src/input.c +++ b/src/input.c @@ -242,8 +242,14 @@ cook_keycode (XKeyEvent *ev, KeySym *keysym, unsigned int *mod, char *keysym_nam | rp_modifier_info.scroll_lock_mask); } + if (len > 0) len--; nbytes = XLookupString (ev, keysym_name, len, keysym, NULL); + /* Null terminate the string (not all X servers do it for us). */ + if (keysym_name) { + keysym_name[nbytes] = '\0'; + } + *mod = ev->state; *mod &= (rp_modifier_info.meta_mod_mask | rp_modifier_info.alt_mod_mask |