static analyzer bit for makemon.c
src/makemon.c(918): warning: Dereferencing NULL pointer '((mon))->mextra'.
This commit is contained in:
@@ -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] */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user