|
From: knittl <kn...@us...> - 2009-08-03 08:40:45
|
Module: performous
Branch: master
Commit: 58e8b8bada7e4eb6421397aa9605a5bb5cae6c4c
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Aug 1 19:35:48 2009 +0300
Fix off-by-one error in array boundary check.
---
game/joystick.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index 8971b60..2c522b5 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -12,7 +12,7 @@ int buttonFromSDL(input::Private::Type _type, unsigned int _sdl_button) {
{ 3, 0, 1, 2, 4, 0 }, // Rock Band guitar
{ 3, 4, 1, 2, 0, 0 } // Rock Band drums
};
- if( _sdl_button > 6 ) return -1;
+ if( _sdl_button >= SDL_BUTTONS ) return -1;
switch(_type) {
case input::Private::GUITAR_GH:
return inputmap[0][_sdl_button];
|