summaryrefslogtreecommitdiff
path: root/libc/unistd/getpass.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-01-11 11:42:17 +0000
committerEric Andersen <andersen@codepoet.org>2001-01-11 11:42:17 +0000
commitae97a89e1a1a9833080dccc81f6cd26784e1b964 (patch)
tree6ff1ddc7e3980591c7fd0bbd5d9b8ac82da12886 /libc/unistd/getpass.c
parentabdc3e4d06db2b9d93c509774fc7c4fde918ec8e (diff)
A large update from Manuel Novoa III <mnovoa3@bellsouth.net>.
Diffstat (limited to 'libc/unistd/getpass.c')
-rw-r--r--libc/unistd/getpass.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libc/unistd/getpass.c b/libc/unistd/getpass.c
index 4fcc489c8..92d3565c8 100644
--- a/libc/unistd/getpass.c
+++ b/libc/unistd/getpass.c
@@ -17,6 +17,7 @@
Boston, MA 02111-1307, USA. */
#include <stdio.h>
+#include <string.h>
#include <termios.h>
#include <unistd.h>
#include <string.h>
@@ -72,9 +73,9 @@ getpass (prompt)
/* Read the password. */
fgets (buf, PWD_BUFFER_SIZE-1, in);
- nread = strlen(buf);
if (buf != NULL)
{
+ nread = strlen(buf);
if (nread < 0)
buf[0] = '\0';
else if (buf[nread - 1] == '\n')