changeset 1886:cd0701292e70

Make mapBlockPrint() only output safe ASCII characters.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 05 Nov 2017 00:51:56 +0200
parents a0d7b4c63fd4
children b42bc3a0b8f9
files libmaputils.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmaputils.c	Sat Nov 04 22:08:14 2017 +0200
+++ b/libmaputils.c	Sun Nov 05 00:51:56 2017 +0200
@@ -799,7 +799,7 @@
         unsigned char *c = map->data + (y * map->scansize);
         for (int x = 0; x < map->width; x++)
         {
-            fputc(*c > 0 ? *c : ' ', fh);
+            fputc(*c >= 32 && *c <= 126 ? *c : ' ', fh);
             c++;
         }
         fprintf(fh, "\n");