]> granicus.if.org Git - nethack/commitdiff
remove unnecessary null checks from christen_monst
authornhmall <nhmall@nethack.org>
Fri, 11 Feb 2022 14:08:31 +0000 (09:08 -0500)
committernhmall <nhmall@nethack.org>
Fri, 11 Feb 2022 14:08:31 +0000 (09:08 -0500)
Closes #681

doc/fixes3-7-0.txt
src/do_name.c

index 7b0f8ae38a3ba0d6f72513bfa2767090f88bf233..28745e48b3633c421ad27bf61238039234cb5e2f 100644 (file)
@@ -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
 -------------------------------
index 35daad658fd963ac5bf85058fe12e3e971a87b76..91f71a0e97e1c0117e934deedbcff21d9bdd4c1d 100644 (file)
@@ -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 "");