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:
+4
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user