D'oh; missed a check in previous patch

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2660 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
mcmartin
2007-01-13 01:37:15 +00:00
parent 1cee0aa1e8
commit 0b4813534e
+3 -3
View File
@@ -209,7 +209,7 @@ TFB_InitInput (int driver, int flags)
SDL_EnableUNICODE(1); SDL_EnableUNICODE(1);
(void)SDL_GetKeyState (&num_keys); (void)SDL_GetKeyState (&num_keys);
kbdstate = (int *)HMalloc (sizeof (int) * num_keys); kbdstate = (int *)HMalloc (sizeof (int) * (num_keys + 1));
#ifdef HAVE_JOYSTICK #ifdef HAVE_JOYSTICK
@@ -327,8 +327,8 @@ ProcessInputEvent (const SDL_Event *Event)
SDLKey k = Event->key.keysym.sym; SDLKey k = Event->key.keysym.sym;
wchar_t map_key = Event->key.keysym.unicode; wchar_t map_key = Event->key.keysym.unicode;
if (k < 0 || k > SDLK_LAST) if (k < 0 || k > num_keys)
k = SDLK_LAST; // for unknown keys k = num_keys; // for unknown keys
if (Event->type == SDL_KEYDOWN) if (Event->type == SDL_KEYDOWN)
{ {