OSDN Git Service
(root)
/
android-x86
/
external-toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
984f90c
)
patch from ashwini sharma: treat 0 length read at the start of password read as EOF.
author
Rob Landley
<rob@landley.net>
Sat, 24 May 2014 17:48:32 +0000
(12:48 -0500)
committer
Rob Landley
<rob@landley.net>
Sat, 24 May 2014 17:48:32 +0000
(12:48 -0500)
lib/password.c
patch
|
blob
|
history
diff --git
a/lib/password.c
b/lib/password.c
index
13a431a
..
930e9c3
100644
(file)
--- 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);