From f68cb0830461ad7e8f5675ef58e0f6dc59d6235f Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 24 Mar 2019 13:03:17 +0200 Subject: [PATCH] Zero an array Valgrind complained about accessing uninitialised memory --- src/uhitm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uhitm.c b/src/uhitm.c index b3a8b10c9..c71d9946a 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -2285,7 +2285,7 @@ register struct monst *mon; struct attack *mattk, alt_attk; struct obj *weapon, **originalweapon; boolean altwep = FALSE, weapon_used = FALSE, odd_claw = TRUE; - int i, tmp, armorpenalty, sum[NATTK], nsum = 0, dhit = 0, attknum = 0; + int i, tmp, armorpenalty, sum[NATTK] = { 0 }, nsum = 0, dhit = 0, attknum = 0; int dieroll, multi_claw = 0; /* with just one touch/claw/weapon attack, both rings matter;