Windows: Fixed ignoring return value of internal function.
If the function WIN_ConvertUTF32toUTF8() failed (should currently not be
possible) a not terminated string would have been sent as text input event.
This also fixed converting characters more often than needed on key repetition.
1.1 --- a/src/video/windows/SDL_windowsevents.c Fri Mar 06 21:29:25 2015 +0100
1.2 +++ b/src/video/windows/SDL_windowsevents.c Fri Mar 06 21:34:10 2015 +0100
1.3 @@ -559,10 +559,11 @@
1.4
1.5 GetKeyboardState(keyboardState);
1.6 if (ToUnicode(wParam, (lParam >> 16) & 0xff, keyboardState, (LPWSTR)&utf32, 1, 0) > 0) {
1.7 - WORD repetition;
1.8 - for (repetition = lParam & 0xffff; repetition > 0; repetition--) {
1.9 - WIN_ConvertUTF32toUTF8(utf32, text);
1.10 - SDL_SendKeyboardText(text);
1.11 + if (WIN_ConvertUTF32toUTF8(utf32, text)) {
1.12 + WORD repetition;
1.13 + for (repetition = lParam & 0xffff; repetition > 0; repetition--) {
1.14 + SDL_SendKeyboardText(text);
1.15 + }
1.16 }
1.17 }
1.18 }