Add a few keyboard tests; fix missing input validation in SDL_GetKeyFromName

This commit is contained in:
Andreas Schiffler 2013-01-07 07:39:15 -08:00
parent 5220df817b
commit 71eabe59cb
2 changed files with 111 additions and 8 deletions

View file

@ -953,6 +953,9 @@ SDL_GetKeyFromName(const char *name)
{
SDL_Keycode key;
/* Check input */
if (name == NULL) return SDLK_UNKNOWN;
/* If it's a single UTF-8 character, then that's the keycode itself */
key = *(const unsigned char *)name;
if (key >= 0xF0) {