aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/gen/readpassphrase.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/gen/readpassphrase.c b/lib/libc/gen/readpassphrase.c
index 18123546c072..983e01d89306 100644
--- a/lib/libc/gen/readpassphrase.c
+++ b/lib/libc/gen/readpassphrase.c
@@ -161,15 +161,15 @@ restart:
return(nr == -1 ? NULL : buf);
}
-#if 0
char *
getpass(const char *prompt)
{
static char buf[_PASSWORD_LEN + 1];
- return(readpassphrase(prompt, buf, sizeof(buf), RPP_ECHO_OFF));
+ if (readpassphrase(prompt, buf, sizeof(buf), RPP_ECHO_OFF) == NULL)
+ buf[0] = '\0';
+ return(buf);
}
-#endif
static void handler(int s)
{