static analyzer bit for makemon.c

src/makemon.c(918): warning: Dereferencing NULL pointer '((mon))->mextra'.
This commit is contained in:
nhmall
2023-12-24 00:40:20 -05:00
parent fbf8e0d5bc
commit a30c5ceba2

View File

@@ -914,8 +914,10 @@ clone_mon(struct monst *mon,
However, tamedog() will not re-tame a tame dog, so m2
must be made non-tame to get initialized properly. */
m2->mtame = 0;
if (tamedog(m2, (struct obj *) 0))
if (tamedog(m2, (struct obj *) 0)) {
assert(has_edog(m2));
*EDOG(m2) = *EDOG(mon);
}
/* [TODO? some (most? all?) edog fields probably should be
reinitialized rather that retain the 'parent's values] */
}