(getpass): Don't barf if getline returns a null BUF.

This commit is contained in:
Miles Bader 1995-12-17 20:58:55 +00:00
parent 102800e09d
commit 5ca8c0ba63

View file

@ -74,7 +74,8 @@ getpass (prompt)
/* Read the password. */
nread = __getline (&buf, &bufsize, in);
if (nread < 0 && buf != NULL)
if (buf != NULL)
if (nread < 0)
buf[0] = '\0';
else if (buf[nread - 1] == '\n')
{