a little extra error checking in keynum lookup
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 12 Sep 2002 12:15:34 +0000 (12:15 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 12 Sep 2002 12:15:34 +0000 (12:15 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2364 d7cf8633-e32d-0410-b094-e92efae38249

keys.c

diff --git a/keys.c b/keys.c
index afd0b70..b60c056 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -461,7 +461,7 @@ void Key_SetBinding (int keynum, char *binding)
        char    *new;
        int             l;
                        
-       if (keynum == -1)
+       if (keynum < 0 || keynum >= 256)
                return;
 
 // free old bindings