diff options
| -rw-r--r-- | dmenu-wl.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -413,8 +413,6 @@ handle_keyboard_event() char buf[8]; int genmatch = 0; - xkb_keysym_to_utf8(client.keys.sym, buf, sizeof(buf)); - if (client.keys.state == WL_KEYBOARD_KEY_STATE_PRESSED) { switch (client.keys.sym) { case XKB_KEY_KP_Enter: /* fallthrough */ @@ -431,7 +429,9 @@ handle_keyboard_event() genmatch = 1; break; default: - strncpy(input_field + strlen(input_field), buf, MAX_LINE_LENGTH - strlen(input_field)); + if (xkb_keysym_to_utf8(client.keys.sym, buf, sizeof(buf))) { + strncpy(input_field + strlen(input_field), buf, MAX_LINE_LENGTH - strlen(input_field)); + } genmatch = 1; break; } |