Remove a useless loop around getpass()

According to getpass(3), this library function cannot return NULL.
Verified with a source code inspection.
This commit is contained in:
khorben 2017-02-20 01:33:28 +00:00
parent 6b2b7082a4
commit b07e8011d2
1 changed files with 2 additions and 3 deletions

View File

@ -54,7 +54,7 @@
#if defined(__NetBSD__)
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
__RCSID("$NetBSD: reader.c,v 1.49 2012/03/05 02:20:18 christos Exp $");
__RCSID("$NetBSD: reader.c,v 1.50 2017/02/20 01:33:28 khorben Exp $");
#endif
#include <sys/types.h>
@ -162,8 +162,7 @@ pgp_getpassphrase(void *in, char *phrase, size_t size)
char *p;
if (in == NULL) {
while ((p = getpass("netpgp passphrase: ")) == NULL) {
}
p = getpass("netpgp passphrase: ");
(void) snprintf(phrase, size, "%s", p);
} else {
if (fgets(phrase, (int)size, in) == NULL) {