From 1e12d7cfb69b0d8a296648027e99880920259d65 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 28 Nov 2023 11:38:35 -0800 Subject: [PATCH] Make sure we don't pass UTF-8 to SDL_iscntrl() This function is only valid for values <= 127. Closes https://github.com/libsdl-org/SDL/pull/8637 --- src/events/SDL_keyboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 2a92707d3..0f7adea2d 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -1063,7 +1063,7 @@ int SDL_SendKeyboardText(const char *text) int posted; /* Don't post text events for unprintable characters */ - if (SDL_iscntrl((int)*text)) { + if (!(*text & 0x80) && SDL_iscntrl(*text)) { return 0; }