shithub: choc

Download patch

ref: 5768550bf021949383c0061f795dbbda9228eda2
parent: 3bbcfdca7dffa5b57b11dea0222b80be779aeb5a
author: Turo Lamminen <turotl@gmail.com>
date: Sat May 26 12:31:03 EDT 2018

d_iwad: Fix const correctness issue in AddIWADPath

--- a/src/d_iwad.c
+++ b/src/d_iwad.c
@@ -573,12 +573,12 @@
 // to the end of the paths before adding them.
 static void AddIWADPath(char *path, char *suffix)
 {
-    char *left, *p;
+    char *left, *p, *dup_path;
 
-    path = M_StringDuplicate(path);
+    dup_path = M_StringDuplicate(path);
 
     // Split into individual dirs within the list.
-    left = path;
+    left = dup_path;
 
     for (;;)
     {
@@ -600,7 +600,7 @@
 
     AddIWADDir(M_StringJoin(left, suffix, NULL));
 
-    free(path);
+    free(dup_path);
 }
 
 #ifndef _WIN32