fixing strdup(NULL) call

This commit is contained in:
Enno Rehling 2008-04-26 23:04:37 +00:00
parent 93091caff0
commit 256d0b1d4b

View file

@ -1650,7 +1650,11 @@ sp_undeadhero(fighter * fi, int level, double power, spell * sp)
/* new units gets some stats from old unit */
free(u->display);
u->display = strdup(du->display);
if (du->display) {
u->display = strdup(du->display);
} else {
u->display = NULL;
}
setstatus(u, du->status);
setguard(u, GUARD_NONE);