]> granicus.if.org Git - nethack/commitdiff
Fix vision if xchar is defined larger than char
authorPasi Kallinen <paxed@alt.org>
Sat, 22 Jan 2022 19:15:44 +0000 (21:15 +0200)
committerPasi Kallinen <paxed@alt.org>
Sat, 22 Jan 2022 19:15:44 +0000 (21:15 +0200)
src/vision.c

index 871c4868c85591846a3871e80970f0eaefe818d4..f819ecde684d25c36219a9a4bddb38710bd56756 100644 (file)
@@ -255,7 +255,7 @@ get_unused_cs(xchar ***rows, xchar **rmin, xchar **rmax)
     nrmin = *rmin;
     nrmax = *rmax;
 
-    (void) memset((genericptr_t) **rows, 0, ROWNO * COLNO); /* see nothing */
+    (void) memset((genericptr_t) **rows, 0, sizeof(xchar) * (ROWNO * COLNO)); /* see nothing */
     for (row = 0; row < ROWNO; row++) { /* set row min & max */
         *nrmin++ = COLNO - 1;
         *nrmax++ = 1;