]> git.sur5r.net Git - i3/i3lock/blobdiff - i3lock.c
Bugfix: When entering 512 characters, you could use neither return nor backspace...
[i3/i3lock] / i3lock.c
index def6116ca1b1db481d9d82abc5ff9cbfbdd72395..2d2cc89c13df791a615226158b646a4496a0154e 100644 (file)
--- 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));
@@ -324,6 +324,8 @@ int main(int argc, char *argv[]) {
             errx(1, "i3lock: Unknown option. Syntax: i3lock [-v] [-n] [-b] [-d] [-c color] [-p win|default]"
 #ifndef NOLIBCAIRO
             " [-i image.png] [-t]"
+#else
+            " (compiled with NOLIBCAIRO)"
 #endif
             "\n");
         }