another try at removing static analyzer complaints

The one in options hasn't been addressed this time.
This commit is contained in:
PatR
2026-05-15 13:40:34 -07:00
parent c558ef0b33
commit e11ff5f703
2 changed files with 4 additions and 3 deletions
+1
View File
@@ -471,6 +471,7 @@ savebones(int how, time_t when, struct obj *corpse)
to be given here, but it has been moved to done() so that to be given here, but it has been moved to done() so that
it gets delivered even when savebones() isn't called] */ it gets delivered even when savebones() isn't called] */
drop_upon_death(mtmp, (struct obj *) 0, u.ux, u.uy); drop_upon_death(mtmp, (struct obj *) 0, u.ux, u.uy);
assert(mtmp != NULL && mtmp->data != NULL); /* static analysis hack */
/* 'mtmp' now has hero's inventory; if 'mtmp' is a mummy, give it /* 'mtmp' now has hero's inventory; if 'mtmp' is a mummy, give it
a wrapping unless already carrying one */ a wrapping unless already carrying one */
if (mtmp->data->mlet == S_MUMMY && !m_carrying(mtmp, MUMMY_WRAPPING)) if (mtmp->data->mlet == S_MUMMY && !m_carrying(mtmp, MUMMY_WRAPPING))
+3 -3
View File
@@ -370,9 +370,6 @@ int
child(int wt) child(int wt)
{ {
int f; int f;
#ifdef CHDIR
const char *home = getenv("HOME");
#endif
suspend_nhwindows((char *) 0); /* also calls end_screen() */ suspend_nhwindows((char *) 0); /* also calls end_screen() */
#ifdef _M_UNIX #ifdef _M_UNIX
@@ -382,6 +379,9 @@ child(int wt)
linux_mapon(); linux_mapon();
#endif #endif
if ((f = fork()) == 0) { /* child */ if ((f = fork()) == 0) { /* child */
#ifdef CHDIR
const char *home = getenv("HOME");
#endif
(void) setgid(getgid()); (void) setgid(getgid());
(void) setuid(getuid()); (void) setuid(getuid());
#ifdef CHDIR #ifdef CHDIR