diff --git a/slock.c b/slock.c index 987b22b..7c396eb 100644 --- a/slock.c +++ b/slock.c @@ -239,7 +239,7 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens, if(passing) continue; - if(ksym == XK_Escape) { + if(len == 0 && ksym == XK_Escape) { dspon = !is_screen_on(dpy); continue; } @@ -259,10 +259,10 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens, explicit_bzero(&passwd, sizeof(passwd)); len = 0; break; - /*case XK_Escape: + case XK_Escape: explicit_bzero(&passwd, sizeof(passwd)); len = 0; - break;*/ + break; case XK_BackSpace: if (len) passwd[--len] = '\0';