Fixed crash if conversion fails. Use ISO name for Latin-1
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402591
This commit is contained in:
parent
4b1e7aae98
commit
6ca6ba5a6b
1 changed files with 5 additions and 3 deletions
|
@ -448,9 +448,11 @@ SDL_GetKeyName(SDLKey key)
|
|||
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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue