~ob/slock

a98fba8971ab4b8d8b1f18422b808a79434d8923 — Markus Teich 6 years ago dc2e8e8
error out early on crypt() fail
1 files changed, 3 insertions(+), 2 deletions(-)

M slock.c
M slock.c => slock.c +3 -2
@@ 321,8 321,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");