Browse Source

Use NUL character constant explicitly

master
FRIGN 8 years ago committed by Markus Teich
parent
commit
b099d2fd18
  1. 4
      slock.c

4
slock.c

@ -158,7 +158,7 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
continue; continue;
switch (ksym) { switch (ksym) {
case XK_Return: case XK_Return:
passwd[len] = 0; passwd[len] = '\0';
errno = 0; errno = 0;
if (!(inputhash = crypt(passwd, hash))) if (!(inputhash = crypt(passwd, hash)))
fprintf(stderr, "slock: crypt: %s\n", strerror(errno)); fprintf(stderr, "slock: crypt: %s\n", strerror(errno));
@ -177,7 +177,7 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
break; break;
case XK_BackSpace: case XK_BackSpace:
if (len) if (len)
passwd[len--] = 0; passwd[len--] = '\0';
break; break;
default: default:
if (num && !iscntrl((int)buf[0]) && if (num && !iscntrl((int)buf[0]) &&

Loading…
Cancel
Save