aboutsummaryrefslogtreecommitdiffstats
path: root/code/client/cl_keys.c
diff options
context:
space:
mode:
Diffstat (limited to 'code/client/cl_keys.c')
-rw-r--r--code/client/cl_keys.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/code/client/cl_keys.c b/code/client/cl_keys.c
index acfe951..a518807 100644
--- a/code/client/cl_keys.c
+++ b/code/client/cl_keys.c
@@ -782,7 +782,7 @@ Key_IsDown
===================
*/
qboolean Key_IsDown( int keynum ) {
- if ( keynum == -1 ) {
+ if ( keynum < 0 || keynum >= MAX_KEYS ) {
return qfalse;
}
@@ -902,7 +902,7 @@ Key_SetBinding
===================
*/
void Key_SetBinding( int keynum, const char *binding ) {
- if ( keynum == -1 ) {
+ if ( keynum < 0 || keynum >= MAX_KEYS ) {
return;
}
@@ -926,7 +926,7 @@ Key_GetBinding
===================
*/
char *Key_GetBinding( int keynum ) {
- if ( keynum == -1 ) {
+ if ( keynum < 0 || keynum >= MAX_KEYS ) {
return "";
}
@@ -943,7 +943,7 @@ int Key_GetKey(const char *binding) {
int i;
if (binding) {
- for (i=0 ; i<256 ; i++) {
+ for (i=0 ; i < MAX_KEYS ; i++) {
if (keys[i].binding && Q_stricmp(binding, keys[i].binding) == 0) {
return i;
}
@@ -986,7 +986,7 @@ void Key_Unbindall_f (void)
{
int i;
- for (i=0 ; i<256 ; i++)
+ for (i=0 ; i < MAX_KEYS; i++)
if (keys[i].binding)
Key_SetBinding (i, "");
}