static analyzer bit for makemon.c

src/makemon.c(907): warning: Dereferencing NULL pointer '((mon))->mextra'.
This commit is contained in:
nhmall
2023-12-27 09:04:33 -05:00
parent 0e70fc5844
commit 5e6d2cd6b5

View File

@@ -904,6 +904,7 @@ clone_mon(struct monst *mon,
int atyp;
newemin(m2);
assert(has_emin(m2) && has_emin(mon));
*EMIN(m2) = *EMIN(mon);
/* renegade when same alignment as hero but not peaceful or
when peaceful while being different alignment from hero */
@@ -915,7 +916,7 @@ clone_mon(struct monst *mon,
must be made non-tame to get initialized properly. */
m2->mtame = 0;
if (tamedog(m2, (struct obj *) 0)) {
assert(has_edog(m2));
assert(has_edog(m2) && has_edog(mon));
*EDOG(m2) = *EDOG(mon);
}
/* [TODO? some (most? all?) edog fields probably should be