forked from github/server
stupid segfault...
This commit is contained in:
parent
0dce9060e9
commit
7ced18cfef
|
@ -231,7 +231,7 @@ cursetype_list * cursetypes[CMAXHASH];
|
||||||
void
|
void
|
||||||
ct_register(const curse_type * ct)
|
ct_register(const curse_type * ct)
|
||||||
{
|
{
|
||||||
unsigned int hash = hashstring(ct->cname);
|
unsigned int hash = hashstring(ct->cname) % CMAXHASH;
|
||||||
cursetype_list ** ctlp = &cursetypes[hash];
|
cursetype_list ** ctlp = &cursetypes[hash];
|
||||||
while (*ctlp) {
|
while (*ctlp) {
|
||||||
cursetype_list * ctl = *ctlp;
|
cursetype_list * ctl = *ctlp;
|
||||||
|
@ -245,7 +245,7 @@ ct_register(const curse_type * ct)
|
||||||
const curse_type *
|
const curse_type *
|
||||||
ct_find(const char *c)
|
ct_find(const char *c)
|
||||||
{
|
{
|
||||||
unsigned int hash = hashstring(c);
|
unsigned int hash = hashstring(c) % CMAXHASH;
|
||||||
cursetype_list * ctl = cursetypes[hash];
|
cursetype_list * ctl = cursetypes[hash];
|
||||||
while (ctl) {
|
while (ctl) {
|
||||||
int k = min(strlen(c), strlen(ctl->type->cname));
|
int k = min(strlen(c), strlen(ctl->type->cname));
|
||||||
|
|
Loading…
Reference in New Issue