summaryrefslogtreecommitdiff
path: root/usr.bin/lock/lock.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2017-07-08 22:01:10 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2017-07-08 22:01:10 +0000
commit705e9bcefd6d4b45092bb561a108b1a7511ef9b4 (patch)
treee110bb4d7926d221cabde8de634c53b0afb7131b /usr.bin/lock/lock.c
parent3266115e39eb2ac3df51165658ff06f44c77fa9b (diff)
can just continue after readpassphrase returns null, the sighandler will
have already printed a message. from Scott Cheloha
Diffstat (limited to 'usr.bin/lock/lock.c')
-rw-r--r--usr.bin/lock/lock.c7
1 files changed, 4 insertions, 3 deletions
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;
}