FS#13695: Fix crash in on-screen keyboard with codepoints > 0x7f

We were passing a utf8 byte sequence into a function expecting
the actual codepoint value.

...This bug has been around approximately forever.

Change-Id: I3f1d8b2508e7fc830ad9ed10bca3c3329c96851c
This commit is contained in:
Solomon Peachy 2025-11-23 08:34:09 -05:00
parent 1bc6b450b9
commit c208b84585

View file

@ -765,7 +765,9 @@ int kbd_input(char* text, int buflen, ucschar_t *kbd)
else if (state.changed == CHANGED_CURSOR) else if (state.changed == CHANGED_CURSOR)
{ {
int c = utf8seek(state.text, state.editpos); int c = utf8seek(state.text, state.editpos);
kbd_spellchar(state.text[c]); ucschar_t ch;
utf8decode(&state.text[c], &ch);
kbd_spellchar(ch);
} }
else if (state.changed == CHANGED_TEXT) else if (state.changed == CHANGED_TEXT)
talk_spell(state.text, false); /* speak revised text */ talk_spell(state.text, false); /* speak revised text */