aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/cruise/background.cpp3
-rw-r--r--engines/cruise/ctp.cpp3
-rw-r--r--engines/cruise/dataLoader.cpp3
3 files changed, 6 insertions, 3 deletions
diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp
index 21e4052dcd..3c16388f74 100644
--- a/engines/cruise/background.cpp
+++ b/engines/cruise/background.cpp
@@ -206,7 +206,8 @@ int loadBackground(const char *name, int idx) {
}
- strcpy(backgroundTable[idx].name, name);
+ if (name != backgroundTable[idx].name)
+ strcpy(backgroundTable[idx].name, name);
return (0);
}
diff --git a/engines/cruise/ctp.cpp b/engines/cruise/ctp.cpp
index 80bd4ffe16..e40df8ad0f 100644
--- a/engines/cruise/ctp.cpp
+++ b/engines/cruise/ctp.cpp
@@ -325,7 +325,8 @@ int initCt(const char *ctpName) {
}
free(ptr);
- strcpy(currentCtpName, ctpName);
+ if (ctpName != currentCtpName)
+ strcpy(currentCtpName, ctpName);
numberOfWalkboxes = segementSizeTable[6] / 2; // get the number of walkboxes
diff --git a/engines/cruise/dataLoader.cpp b/engines/cruise/dataLoader.cpp
index b458bee9d3..69fcc12b1e 100644
--- a/engines/cruise/dataLoader.cpp
+++ b/engines/cruise/dataLoader.cpp
@@ -499,7 +499,8 @@ int loadSetEntry(const char *name, uint8 *ptr, int currentEntryIdx, int currentD
}
}
- strcpy(filesDatabase[fileIndex].subData.name, name);
+ if (name != filesDatabase[fileIndex].subData.name)
+ strcpy(filesDatabase[fileIndex].subData.name, name);
// create the mask
switch (localBuffer.type) {