mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-02-17 01:31:47 +00:00
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:
parent
3c01757d27
commit
bbcb2b00dc
1 changed files with 2 additions and 2 deletions
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in a new issue