ufindhash negative ids assert

This commit is contained in:
Enno Rehling 2007-12-13 16:18:20 +00:00
parent a59a80d35e
commit 1d47c99f18

View file

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