Skip to content

Commit

Permalink
Emscripten: Fixed ignoring return value of internal function.
Browse files Browse the repository at this point in the history
If the function Emscripten_ConvertUTF32toUTF8() failed (should currently not be
possible) a not terminated string would have been sent as text input event.
  • Loading branch information
philippwiesemann committed Mar 6, 2015
1 parent 1686af7 commit 8f4c2a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/video/emscripten/SDL_emscriptenevents.c
Expand Up @@ -447,8 +447,9 @@ EM_BOOL
Emscripten_HandleKeyPress(int eventType, const EmscriptenKeyboardEvent *keyEvent, void *userData)
{
char text[5];
Emscripten_ConvertUTF32toUTF8(keyEvent->charCode, text);
SDL_SendKeyboardText(text);
if (Emscripten_ConvertUTF32toUTF8(keyEvent->charCode, text)) {
SDL_SendKeyboardText(text);
}
return 1;
}

Expand Down

0 comments on commit 8f4c2a8

Please sign in to comment.