Fix some crashes that happened while debugging an old data file.

This commit is contained in:
Enno Rehling 2014-10-31 15:52:40 +01:00
parent 838155179f
commit 997d1ffd4b
2 changed files with 5 additions and 4 deletions

View File

@ -1119,6 +1119,10 @@ static ally **addally(const faction * f, ally ** sfp, int aid, int state)
if (state == 0)
return sfp;
while (*sfp) {
sfp = &(*sfp)->next;
}
sf = ally_add(sfp, af);
if (!sf->faction) {
variant id;
@ -1127,9 +1131,6 @@ static ally **addally(const faction * f, ally ** sfp, int aid, int state)
}
sf->status = state & HELP_ALL;
while (*sfp)
sfp = &(*sfp)->next;
*sfp = sf;
return &sf->next;
}

View File

@ -1183,7 +1183,7 @@ link_seen(seen_region * seehash[], const region * first, const region * last)
}
r = r->next;
}
sr->next = 0;
if (sr) sr->next = 0;
}
seen_region *find_seen(struct seen_region *seehash[], const region * r)