1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-08-16 09:31:37 +01:00

Fix off-by-one error in safety check

This commit is contained in:
NeroOneTrueKing 2020-09-30 14:05:01 -05:00
parent 866dc5b2c0
commit 5509301ba2

View file

@ -375,7 +375,7 @@ bot1()
char tmp[MAXCO];
char *p = tmp;
int filledbar = ((uhp() < 0) ? 0 : uhp()) * bar_length / uhpmax();
if (filledbar >= MAXCO) { filledbar = MAXCO-1; }
if (filledbar >= MAXCO-1) { filledbar = MAXCO-2; }
Strcpy(tmp, newbot1);
p++;