aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/password.c2
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);