From 3f3d1ad85c613de5aa6d51176a13553a779f5bfa Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 25 Nov 2021 13:17:03 -0800 Subject: [PATCH] suppress warning The compiler which suggested that 'aname' might be used without being initialized is wrong, but this should pacify it. --- src/objnam.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/objnam.c b/src/objnam.c index 86617bcf2..2ec3ef225 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1031,7 +1031,7 @@ doname_base( char tmpbuf[PREFIX + 1]; /* for when we have to add something at * the start of prefix instead of the * end (Strcat is used on the end) */ - const char *aname; + const char *aname = 0; int omndx = obj->corpsenm; register char *bp = xname(obj); @@ -1061,7 +1061,7 @@ doname_base( want "the" prefix and when it doesn't, avoid "a"/"an" prefix too */ fake_arti = (obj->otyp == SLIME_MOLD && (aname = artifact_name(bp, (short *) 0)) != 0); - force_the = (fake_arti && aname && !strncmpi(aname, "the ", 4)); + force_the = (fake_arti && !strncmpi(aname, "the ", 4)); prefix[0] = '\0'; if (obj->quan != 1L) {