diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 2a26f3f50..9dd80e6ef 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -607,6 +607,7 @@ void I_GetConsoleEvents(void) return; ev.type = ev_console; + ev.key = 0; if (read(STDIN_FILENO, &key, 1) == -1 || !key) return; @@ -633,7 +634,7 @@ void I_GetConsoleEvents(void) } else return; } - else + else if (tty_con.cursor < sizeof (tty_con.buffer)) { // push regular character ev.key = tty_con.buffer[tty_con.cursor] = key;