From 1a1adfee3ed55f7b615f57f551ae95b964ad6211 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 23 Dec 2016 13:34:06 +0200 Subject: [PATCH] Fix valgrind complaint in wizmode terrain The code was writing characters into row[x-1] in the loop, but putting the string terminator at row[x], leaving one character between uninitialized. --- src/cmd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmd.c b/src/cmd.c index 317405b45..a1020bdba 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -920,6 +920,7 @@ wiz_map_levltyp(VOID_ARGS) ? 'a' + terrain - 10 : 'A' + terrain - 36); } + x--; if (levl[0][y].typ != STONE || may_dig(0, y)) row[x++] = '!'; row[x] = '\0';