Add a few keyboard tests; fix missing input validation in SDL_GetKeyFromName
This commit is contained in:
parent
5220df817b
commit
71eabe59cb
2 changed files with 111 additions and 8 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue