Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed array overrun
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Feb 7, 2008
1 parent 36d8a26 commit a0c5f23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/events/SDL_keyboard_c.h
Expand Up @@ -37,7 +37,7 @@ struct SDL_Keyboard
/* Data common to all keyboards */
SDL_WindowID focus;
Uint16 modstate;
Uint8 keystate[(SDL_NUM_SCANCODES + 7) / 8];
Uint8 keystate[SDL_NUM_SCANCODES];
SDLKey keymap[SDL_NUM_SCANCODES];

void *driverdata;
Expand Down
6 changes: 4 additions & 2 deletions test/checkkeys.c
Expand Up @@ -63,8 +63,10 @@ PrintKey(SDL_keysym * sym, int pressed)
SDL_GetScancodeName(sym->scancode),
sym->sym, SDL_GetKeyName(sym->sym));
} else {
printf("Unknown Key (scancode = 0x%04X) %s ",
sym->scancode, pressed ? "pressed" : "released");
printf("Unknown Key (scancode = 0x%04X = %s) %s ",
sym->scancode,
SDL_GetScancodeName(sym->scancode),
pressed ? "pressed" : "released");
}

/* Print the translated character, if one exists */
Expand Down

0 comments on commit a0c5f23

Please sign in to comment.