cvar_t *var;
// 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;
for (var = cvar_hashtable[hashindex];var;var = var->nextonhashchain)
if (!strcmp (var_name, var->name))
return var;
variable->next = next;
// link to head of list in this hash table index
- hashindex = CRC_Block((const unsigned char *)variable->name, strlen(variable->name));
+ hashindex = CRC_Block((const unsigned char *)variable->name, strlen(variable->name)) % CVAR_HASHSIZE;
variable->nextonhashchain = cvar_hashtable[hashindex];
cvar_hashtable[hashindex] = variable;
}
cvar->next = next;
// link to head of list in this hash table index
- hashindex = CRC_Block((const unsigned char *)cvar->name, strlen(cvar->name));
+ hashindex = CRC_Block((const unsigned char *)cvar->name, strlen(cvar->name)) % CVAR_HASHSIZE;
cvar->nextonhashchain = cvar_hashtable[hashindex];
cvar_hashtable[hashindex] = cvar;