From: tedu Date: Sat, 8 Jul 2017 22:01:09 +0000 (+0000) Subject: can just continue after readpassphrase returns null, the sighandler will X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c24b2f3d2e4baf148da4d09ab97a3037f16a29d3;p=openbsd can just continue after readpassphrase returns null, the sighandler will have already printed a message. from Scott Cheloha --- diff --git a/usr.bin/lock/lock.c b/usr.bin/lock/lock.c index b403f55459c..1dc0dd17a5b 100644 --- a/usr.bin/lock/lock.c +++ b/usr.bin/lock/lock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lock.c,v 1.34 2017/05/03 09:51:39 mestre Exp $ */ +/* $OpenBSD: lock.c,v 1.35 2017/07/08 22:01:09 tedu Exp $ */ /* $NetBSD: lock.c,v 1.8 1996/05/07 18:32:31 jtc Exp $ */ /* @@ -188,8 +188,9 @@ main(int argc, char *argv[]) } for (cnt = 0;;) { - if (!readpassphrase("Key: ", s, sizeof(s), RPP_ECHO_OFF) || - *s == '\0') { + if (!readpassphrase("Key: ", s, sizeof(s), RPP_ECHO_OFF)) + continue; + if (strlen(s) == 0) { hi(0); continue; }