address another warning

sounds.c: In function ‘domonnoise’:
sounds.c:818:40: warning: array subscript [0, 1] is outside array bounds of ‘const char * const[2]’ [-Warray-bounds=]
  818 |                     verbl_msg = vampmsg[vampindex];
      |                                 ~~~~~~~^~~~~~~~~~~
sounds.c:786:38: note: while referencing ‘vampmsg’
  786 |             static const char *const vampmsg[] = {
      |                                      ^~~~~~~
This commit is contained in:
nhmall
2026-06-26 15:11:42 -04:00
parent c40bf4658d
commit 2b2f949484
+4 -2
View File
@@ -814,8 +814,10 @@ domonnoise(struct monst *mtmp)
flags.female ? FEMALE : MALE))
: an(racenoun));
verbl_msg = verbuf;
} else
verbl_msg = vampmsg[vampindex];
} else if (vampindex > 1) {
if (vampindex >= 0 && vampindex < SIZE(vampmsg))
verbl_msg = vampmsg[vampindex];
}
}
}
break;