Skip to content

Commit

Permalink
Check if call to SDL_iconv_utf8_ucs4() is NULL
Browse files Browse the repository at this point in the history
See comments on commit ca7f8ba and issue #766. @devnexen and @josephreynolds1, could you please confirm if this works?
  • Loading branch information
bradharding committed Feb 16, 2023
1 parent 517ada8 commit 053cffc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/i_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,10 @@ static void I_GetEvent(void)

case SDL_TEXTINPUT:
{
void *text = SDL_iconv_utf8_ucs4(Event->text.text);

ev.data1 = (text ? ((char *)text)[0] : Event->text.text[strlen(Event->text.text) - 1]);
ev.type = ev_textinput;
ev.data1 = ((char *)SDL_iconv_utf8_ucs4(Event->text.text))[0];
D_PostEvent(&ev);
break;
}
Expand Down

2 comments on commit 053cffc

@devnexen
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes your fallback solution works fine :)

@bradharding
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes your fallback solution works fine :)

That's great! Thanks again David!

Please sign in to comment.