aboutsummaryrefslogtreecommitdiff
path: root/toys/other
diff options
context:
space:
mode:
authorJonathan Clairembault <jonathan@clairembault.fr>2012-11-27 11:09:04 +0100
committerJonathan Clairembault <jonathan@clairembault.fr>2012-11-27 11:09:04 +0100
commita03f3e120c96ed58e6913dae3d21bdea59390c2b (patch)
tree42b9b8513fa710aaf899089e4084d7f8172cd84d /toys/other
parent11ca9293c62041d5d0a4c44de21ba786524bfac3 (diff)
downloadtoybox-a03f3e120c96ed58e6913dae3d21bdea59390c2b.tar.gz
login: Avoid gcc to drop exit condition because of "always false condition".
Diffstat (limited to 'toys/other')
-rw-r--r--toys/other/login.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/toys/other/login.c b/toys/other/login.c
index 72d7063e..54190d0f 100644
--- a/toys/other/login.c
+++ b/toys/other/login.c
@@ -68,8 +68,9 @@ void read_user(char * buff, int size)
fflush(stdout);
do {
- buff[0] = getchar();
- if (buff[0] == EOF) exit(EXIT_FAILURE);
+ int c = getchar();
+ if (c == EOF) exit(EXIT_FAILURE);
+ buff[0] = c;
} while (isblank(buff[0]));
if (buff[0] != '\n') if(!fgets(&buff[1], HOSTNAME_SIZE-1, stdin)) _exit(1);