foxygit / doom Log in
commit 5768550bf021949383c0061f795dbbda9228eda2
Author:     Turo Lamminen <turotl@gmail.com>
AuthorDate: Sat May 26 16:31:03 2018 +0300
Commit:     Turo Lamminen <turotl@gmail.com>
CommitDate: Sat May 26 16:31:03 2018 +0300

    d_iwad: Fix const correctness issue in AddIWADPath
---
 src/d_iwad.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/d_iwad.c b/src/d_iwad.c
index 554267a6..c24e2c46 100644
--- a/src/d_iwad.c
+++ b/src/d_iwad.c
@@ -573,12 +573,12 @@ static GameMission_t IdentifyIWADByName(char *name, int mask)
 // 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 @@ static void AddIWADPath(char *path, char *suffix)

     AddIWADDir(M_StringJoin(left, suffix, NULL));

-    free(path);
+    free(dup_path);
 }

 #ifndef _WIN32