diff options
-rw-r--r-- | slock.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -133,7 +133,7 @@ readpw(Display *dpy, const char *pws) | |||
133 | while (running && !XNextEvent(dpy, &ev)) { | 133 | while (running && !XNextEvent(dpy, &ev)) { |
134 | if (ev.type == KeyPress) { | 134 | if (ev.type == KeyPress) { |
135 | buf[0] = 0; | 135 | buf[0] = 0; |
136 | num = XLookupString(&ev.xkey, buf, sizeof buf, &ksym, 0); | 136 | num = XLookupString(&ev.xkey, buf, sizeof(buf), &ksym, 0); |
137 | if (IsKeypadKey(ksym)) { | 137 | if (IsKeypadKey(ksym)) { |
138 | if (ksym == XK_KP_Enter) | 138 | if (ksym == XK_KP_Enter) |
139 | ksym = XK_Return; | 139 | ksym = XK_Return; |
@@ -168,7 +168,7 @@ readpw(Display *dpy, const char *pws) | |||
168 | --len; | 168 | --len; |
169 | break; | 169 | break; |
170 | default: | 170 | default: |
171 | if (num && !iscntrl((int) buf[0]) && (len + num < sizeof passwd)) { | 171 | if (num && !iscntrl((int) buf[0]) && (len + num < sizeof(passwd))) { |
172 | memcpy(passwd + len, buf, num); | 172 | memcpy(passwd + len, buf, num); |
173 | len += num; | 173 | len += num; |
174 | } | 174 | } |