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.
This commit is contained in:
@@ -920,6 +920,7 @@ wiz_map_levltyp(VOID_ARGS)
|
|||||||
? 'a' + terrain - 10
|
? 'a' + terrain - 10
|
||||||
: 'A' + terrain - 36);
|
: 'A' + terrain - 36);
|
||||||
}
|
}
|
||||||
|
x--;
|
||||||
if (levl[0][y].typ != STONE || may_dig(0, y))
|
if (levl[0][y].typ != STONE || may_dig(0, y))
|
||||||
row[x++] = '!';
|
row[x++] = '!';
|
||||||
row[x] = '\0';
|
row[x] = '\0';
|
||||||
|
|||||||
Reference in New Issue
Block a user