From: nhmall Date: Fri, 11 Feb 2022 14:08:31 +0000 (-0500) Subject: remove unnecessary null checks from christen_monst X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5faace8b9e2bf82d6d5ace9d3fb6a0bf3ed17ffd;p=nethack remove unnecessary null checks from christen_monst Closes #681 --- diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 7b0f8ae38..28745e48b 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1537,7 +1537,8 @@ function savelev() in save.c was dereferencing a NHFILE pointer for function tin_details() in eat.c was passing an obj pointer to tin_variety() where it was dereferenced; move the tin_details() NULL check above that tin_variety() call (pr #676 by argrath) - +remove unnecessary null checks from christen_orc() (pr #681 by argrath) + Code Cleanup and Reorganization ------------------------------- diff --git a/src/do_name.c b/src/do_name.c index 35daad658..91f71a0e9 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -2415,7 +2415,7 @@ christen_orc(struct monst *mtmp, const char *gang, const char *other) char buf[BUFSZ], buf2[BUFSZ], *orcname; orcname = rndorcname(buf2); - /* orcname is never NULL */ + /* rndorcname() won't return NULL */ sz = (int) strlen(orcname); if (gang) sz += (int) (strlen(gang) + sizeof " of " - sizeof "");