From 1f651f8f00bb2038d3edcf8d03d6f3a6d3127c56 Mon Sep 17 00:00:00 2001 From: SHIRAKATA Kentaro Date: Thu, 21 Oct 2021 21:17:36 +0900 Subject: [PATCH] initialize attknum `attknum` is declared without initialization, and is used on find_roll_to_hit(). This leads unexpected result. --- src/uhitm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uhitm.c b/src/uhitm.c index 064779286..928acae7d 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -580,7 +580,7 @@ hitum_cleave(struct monst *target, /* non-Null; forcefight at nothing doesn't */ for (count = 3; count > 0; --count) { struct monst *mtmp; - int tx, ty, tmp, dieroll, mhit, attknum, armorpenalty; + int tx, ty, tmp, dieroll, mhit, attknum = 0, armorpenalty; /* ++i, wrap 8 to i=0 /or/ --i, wrap -1 to i=7 */ i = clockwise ? DIR_RIGHT(i) : DIR_LEFT(i);