diff options
author | Rob Landley <rob@landley.net> | 2014-05-24 12:48:32 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2014-05-24 12:48:32 -0500 |
commit | a17c5f22632b74aa17b1e395c0b175d7c1f52ab9 (patch) | |
tree | 270ca1805547d97cf8f1c04da8ecd615256d1a32 | |
parent | 984f90c07025168bf2b42ec37f027005229daa02 (diff) | |
download | toybox-a17c5f22632b74aa17b1e395c0b175d7c1f52ab9.tar.gz |
patch from ashwini sharma: treat 0 length read at the start of password read as EOF.
-rw-r--r-- | lib/password.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/password.c b/lib/password.c index 13a431ac..930e9c36 100644 --- a/lib/password.c +++ b/lib/password.c @@ -79,7 +79,7 @@ int read_password(char * buff, int buflen, char* mesg) while (1) { int ret = read(0, &buff[i], 1); - if ( ret < 0 ) { + if ( ret < 0 || (!ret && !i)) { buff[0] = 0; sigaction(SIGINT, &oldsa, NULL); tcsetattr(0, TCSANOW, &oldtermio); |