]> granicus.if.org Git - nethack/commitdiff
Explicitly set the altlabels array size
authorPasi Kallinen <paxed@alt.org>
Wed, 28 Jul 2021 04:45:21 +0000 (07:45 +0300)
committerPasi Kallinen <paxed@alt.org>
Wed, 28 Jul 2021 04:45:25 +0000 (07:45 +0300)
This will allow the compiler to complain after you add new glyphs.

src/drawing.c
win/share/tilemap.c

index c5e1d33d52e0dd9d6592aa05d1856202b89cb7bb..0f24545acd48a2233d172122d4faa26fda71a7c8 100644 (file)
@@ -131,7 +131,7 @@ const struct symdef def_warnsyms[WARNCOUNT] = {
  *
  *  If adding to or removing from this list, please note that,
  *  for builds with tile support, there is an array called altlabels[] in
- *  win/share/tiletext.c that requires the same number of elements as
+ *  win/share/tilemap.c that requires the same number of elements as
  *  this, in the same order. It is used for tile name matching when
  *  parsing other.txt because some of the useful tile names don't exist
  *  within NetHack itself.
index 6716e66d25a912758ede244a890c18157fc693c4..3f7bcf7210c3d1bcc7a00353ee97e90b55978cc7 100644 (file)
@@ -704,7 +704,7 @@ struct {
     int idx;
     const char *betterlabel;
     const char *expectedlabel;
-} altlabels[] = {
+} altlabels[MAXPCHARS] = {
 {S_stone,    "dark part of a room", "dark part of a room"},
 {S_vwall,    "vertical wall", "wall"},
 {S_hwall,    "horizontal wall", "wall"},