# HG changeset patch # User Jonathan Clairembault # Date 1354010944 -3600 # Node ID 0ed3351d91eb68c3eab3917eb4d5db7fc3bb18a3 # Parent 54294a48a09bdecf9b800f2bd3c8e23e320ace3b login: Avoid gcc to drop exit condition because of "always false condition". diff -r 54294a48a09b -r 0ed3351d91eb toys/other/login.c --- a/toys/other/login.c Tue Nov 27 13:55:57 2012 -0600 +++ b/toys/other/login.c Tue Nov 27 11:09:04 2012 +0100 @@ -68,8 +68,9 @@ 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);