ufindhash negative ids assert

This commit is contained in:
Enno Rehling 2007-12-13 16:18:20 +00:00
parent a59a80d35e
commit 1d47c99f18
1 changed files with 7 additions and 3 deletions

View File

@ -659,9 +659,13 @@ uunhash (unit * u)
unit * unit *
ufindhash (int i) ufindhash (int i)
{ {
unit * u = unithash[i % UMAXHASH]; assert(i>=0);
while (u && u->no!=i) u = u->nexthash; if (i>=0) {
return u; unit * u = unithash[i % UMAXHASH];
while (u && u->no!=i) u = u->nexthash;
return u;
}
return NULL;
} }
#define FMAXHASH 2039 #define FMAXHASH 2039