From: Michael Stapelberg Date: Sat, 6 Nov 2010 17:02:44 +0000 (+0100) Subject: Bugfix: When entering 512 characters, you could use neither return nor backspace... X-Git-Tag: 2.1~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3a22727bffbf9519ed81e7cce7a73ed0774788db;p=i3%2Fi3lock Bugfix: When entering 512 characters, you could use neither return nor backspace (Thanks carl) --- diff --git a/i3lock.c b/i3lock.c index fafbe80..2d2cc89 100644 --- a/i3lock.c +++ b/i3lock.c @@ -129,9 +129,6 @@ static void handle_key_press(xcb_key_press_event_t *event) { * keysyms, we remove the numlock flag from the event state */ event->state &= ~numlockmask; - if ((input_position + 8) >= sizeof(password)) - return; - xcb_keysym_t sym = xcb_key_press_lookup_keysym(symbols, event, event->state); switch (sym) { case XK_Mode_switch: @@ -157,6 +154,9 @@ static void handle_key_press(xcb_key_press_event_t *event) { return; } + if ((input_position + 8) >= sizeof(password)) + return; + #if 0 /* FIXME: handle all of these? */ printf("is_keypad_key = %d\n", xcb_is_keypad_key(sym));