static analyzer bit for makemon.c
src/makemon.c(907): warning: Dereferencing NULL pointer '((mon))->mextra'.
This commit is contained in:
+2
-1
@@ -904,6 +904,7 @@ clone_mon(struct monst *mon,
|
|||||||
int atyp;
|
int atyp;
|
||||||
|
|
||||||
newemin(m2);
|
newemin(m2);
|
||||||
|
assert(has_emin(m2) && has_emin(mon));
|
||||||
*EMIN(m2) = *EMIN(mon);
|
*EMIN(m2) = *EMIN(mon);
|
||||||
/* renegade when same alignment as hero but not peaceful or
|
/* renegade when same alignment as hero but not peaceful or
|
||||||
when peaceful while being different alignment from hero */
|
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. */
|
must be made non-tame to get initialized properly. */
|
||||||
m2->mtame = 0;
|
m2->mtame = 0;
|
||||||
if (tamedog(m2, (struct obj *) 0)) {
|
if (tamedog(m2, (struct obj *) 0)) {
|
||||||
assert(has_edog(m2));
|
assert(has_edog(m2) && has_edog(mon));
|
||||||
*EDOG(m2) = *EDOG(mon);
|
*EDOG(m2) = *EDOG(mon);
|
||||||
}
|
}
|
||||||
/* [TODO? some (most? all?) edog fields probably should be
|
/* [TODO? some (most? all?) edog fields probably should be
|
||||||
|
|||||||
Reference in New Issue
Block a user