diff --git a/src/bones.c b/src/bones.c index d7837536a..092ed203a 100644 --- a/src/bones.c +++ b/src/bones.c @@ -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 it gets delivered even when savebones() isn't called] */ 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 a wrapping unless already carrying one */ if (mtmp->data->mlet == S_MUMMY && !m_carrying(mtmp, MUMMY_WRAPPING)) diff --git a/sys/unix/unixunix.c b/sys/unix/unixunix.c index 55c173004..a7fb3f92e 100644 --- a/sys/unix/unixunix.c +++ b/sys/unix/unixunix.c @@ -370,9 +370,6 @@ int child(int wt) { int f; -#ifdef CHDIR - const char *home = getenv("HOME"); -#endif suspend_nhwindows((char *) 0); /* also calls end_screen() */ #ifdef _M_UNIX @@ -382,6 +379,9 @@ child(int wt) linux_mapon(); #endif if ((f = fork()) == 0) { /* child */ +#ifdef CHDIR + const char *home = getenv("HOME"); +#endif (void) setgid(getgid()); (void) setuid(getuid()); #ifdef CHDIR