summaryrefslogtreecommitdiffstats
path: root/slock.c
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2023-09-28 02:15:31 +0200
committerLouis Burda <quent.burda@gmail.com>2023-09-28 02:19:17 +0200
commit5fa767f5f20a025793d4968f9421e946c1612c4b (patch)
tree604bfb1dccef50cf8caee5bd0c4a22a9e8fe7ca4 /slock.c
parent370a6fe6e9c4fe8269c6f75a19c4d5159d7a51d6 (diff)
downloadslock-5fa767f5f20a025793d4968f9421e946c1612c4b.tar.gz
slock-5fa767f5f20a025793d4968f9421e946c1612c4b.zip
Ignore initial control modifier keypresse
Diffstat (limited to 'slock.c')
-rw-r--r--slock.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/slock.c b/slock.c
index 962bf7d..8974197 100644
--- a/slock.c
+++ b/slock.c
@@ -184,8 +184,9 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
passwd[--len] = '\0';
break;
default:
- if (num && !iscntrl((int)buf[0]) &&
- (len + num < sizeof(passwd))) {
+ if (controlkeyclear && iscntrl((int)buf[0]))
+ continue;
+ if (num && (len + num < sizeof(passwd))) {
memcpy(passwd + len, buf, num);
len += num;
}