static analyzer bit for do_name.c

src/do_name.c(1494): warning C28183: 'aname' could be '0'
This commit is contained in:
nhmall
2023-12-27 10:40:02 -05:00
parent 5e6d2cd6b5
commit 6d8c37b754

View File

@@ -1488,6 +1488,7 @@ do_oname(struct obj *obj)
a valid artifact name */
u.uconduct.literate++;
} else if (obj->otyp == objtyp) {
assert(aname != 0);
/* artifact_name() found a match and restrict_name() didn't reject
it; since 'obj' is the right type, naming will change it into an
artifact so use canonical capitalization (Sting or Orcrist) */