changeset 1866:d575c74e049b

Use muStrChr() instead of strchr() in mapBlockClean().
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 03 Nov 2017 23:49:16 +0200
parents e84f37f49c03
children 8204a8c44dba
files libmaputils.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmaputils.c	Fri Nov 03 23:48:53 2017 +0200
+++ b/libmaputils.c	Fri Nov 03 23:49:16 2017 +0200
@@ -774,12 +774,13 @@
     assert(map != NULL);
     assert(symbols != NULL);
 
+    const size_t nsymbols = strlen(symbols);
     for (int y = 0; y < map->height; y++)
     {
         unsigned char *dp = map->data + (y * map->scansize);
         for (int x = 0; x < map->width; x++)
         {
-            if (strchr(symbols, *dp) != NULL)
+            if (muStrChr((unsigned char*) symbols, nsymbols, *dp))
                 *dp = 0;
             dp++;
         }