From 9fbd7527f5af87f73559110b22c6c689ea824d97 Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Mon, 8 Jun 2020 22:12:18 +0000 Subject: [PATCH] Add missing modulo in cvar hashtable lookup git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12657 d7cf8633-e32d-0410-b094-e92efae38249 --- cvar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cvar.c b/cvar.c index fdd39e27..7022f085 100644 --- a/cvar.c +++ b/cvar.c @@ -79,7 +79,7 @@ static cvar_hash_t *Cvar_FindVarLink(cvar_state_t *cvars, const char *var_name, cvar_hash_t *hash; // use hash lookup to minimize search time - hashindex = CRC_Block((const unsigned char *)var_name, strlen(var_name)); + hashindex = CRC_Block((const unsigned char *)var_name, strlen(var_name)) % CVAR_HASHSIZE; if(parent) *parent = NULL; if(prev_alpha) *prev_alpha = NULL; if(link) *link = &cvars->hashtable[hashindex]; -- 2.39.2