Fix endless loop with in_tty on selected archs

Ran into this on aarch64.

Quoting http://c-faq.com/stdio/getcharc.html
"The bug can go undetected for a long time" :)

Fixes #102
This commit is contained in:
Andre Heider 2018-02-22 22:10:20 +01:00
parent 3c01757d27
commit bbcb2b00dc

View file

@ -497,7 +497,7 @@ void tty_Show() {
}
void tty_FlushIn() {
char key;
int key;
while ( ( key = getchar() ) != EOF ) {
Sys_Printf( "'%d' ", key );
}
@ -513,7 +513,7 @@ Return NULL if a complete line is not ready.
*/
char *Sys_ConsoleInput( void ) {
if ( tty_enabled ) {
char key;
int key;
bool hidden = false;
while ( ( key = getchar() ) != EOF ) {
if ( !hidden ) {