From 29acff6722b71c17999de48b4839cbf55bd9a0d4 Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 2 Apr 2024 15:19:25 +0200 Subject: [PATCH] make this less fragile --- src/sdl/i_video.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index f5e84cc88..f4d6c4f7a 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -411,13 +411,10 @@ static INT32 GetTypedChar(SDL_Scancode code, SDL_Keysym *sym) break; } - if (SDL_PollEvent(&next_event) && next_event.type == SDL_TEXTINPUT) + while (SDL_PollEvent(&next_event) && next_event.type == SDL_TEXTINPUT) { if (next_event.text.text[1] == '\0') // limit to ASCII - { - if (strlen(next_event.text.text) == 1) - return next_event.text.text[0]; - } + return next_event.text.text[0]; } return Impl_SDL_Scancode_To_Keycode(code); //fallback