null-pointer crash

This commit is contained in:
Enno Rehling 2004-05-30 12:18:00 +00:00
parent 35b8a137ab
commit c087ca8b98
1 changed files with 1 additions and 1 deletions

View File

@ -3616,7 +3616,7 @@ battle_stats(FILE * F, battle * b)
slist = &(*slist)->next;
}
stat = *slist;
if (stat->wp!=wp || stat->level!=level) {
if (stat==NULL || stat->wp!=wp || stat->level!=level) {
stat = calloc(1, sizeof(stat_info));
stat->wp = wp;
stat->level = level;