From: havoc Date: Thu, 12 Sep 2002 12:15:34 +0000 (+0000) Subject: a little extra error checking in keynum lookup X-Git-Tag: RELEASE_0_2_0_RC1~242 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=dfc61f260d44d0442640e288171fb165bd251d7b;p=xonotic%2Fdarkplaces.git a little extra error checking in keynum lookup git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2364 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/keys.c b/keys.c index afd0b70f..b60c056a 100644 --- 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