Mercurial > sdl-ios-xcode
diff src/events/SDL_keyboard.c @ 2229:22342048bcb8
Fixed crash if conversion fails. Use ISO name for Latin-1
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 12 Aug 2007 05:48:51 +0000 |
parents | 047245361002 |
children | 4baee598306d |
line wrap: on
line diff
--- a/src/events/SDL_keyboard.c Sun Aug 12 00:01:41 2007 +0000 +++ b/src/events/SDL_keyboard.c Sun Aug 12 05:48:51 2007 +0000 @@ -448,9 +448,11 @@ char *cvt; temp[0] = (char) key; temp[1] = '\0'; - cvt = SDL_iconv_string("UTF-8", "LATIN1", temp, 1); - SDL_strlcpy(temp, cvt, SDL_arraysize(temp)); - SDL_free(cvt); + cvt = SDL_iconv_string("UTF-8", "ISO-8859-1", temp, 1); + if (cvt) { + SDL_strlcpy(temp, cvt, SDL_arraysize(temp)); + SDL_free(cvt); + } keyname = temp; } else { keyname = "unknown key";