X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=slock.c;h=c81f5dd8e9cd66b216d5a8fb66e5ddcc7f46b3f7;hb=2d85c5baed4c4b4ecc19f7934fac1fc6a5b5c410;hp=6dedc69944ca49e43104f4a81513448e0e9a0af0;hpb=dc2e8e839e4d72f5fec36c9a0474e6062a7a8f51;p=slock.git diff --git a/slock.c b/slock.c index 6dedc69..c81f5dd 100644 --- a/slock.c +++ b/slock.c @@ -137,10 +137,6 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens, running = 1; failure = 0; - /* As "slock" stands for "Simple X display locker", the DPMS settings - * had been removed and you can set it with "xset" or some other - * utility. This way the user can easily set a customized DPMS - * timeout. */ while (running && !XNextEvent(dpy, &ev)) { if (ev.type == KeyPress) { explicit_bzero(&buf, sizeof(buf)); @@ -321,8 +317,9 @@ main(int argc, char **argv) { #endif hash = gethash(); - if (strlen(hash) < 2) - die("slock: failed to get user password hash.\n"); + errno = 0; + if (!crypt("", hash)) + die("slock: crypt: %s\n", strerror(errno)); if (!(dpy = XOpenDisplay(NULL))) die("slock: cannot open display\n");