aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/cine/bg.cpp6
-rw-r--r--engines/cine/part.cpp3
-rw-r--r--engines/cine/various.cpp2
3 files changed, 7 insertions, 4 deletions
diff --git a/engines/cine/bg.cpp b/engines/cine/bg.cpp
index c368868113..32b59e0554 100644
--- a/engines/cine/bg.cpp
+++ b/engines/cine/bg.cpp
@@ -42,7 +42,8 @@ byte loadCt(const char *ctName) {
uint16 header[32];
byte *ptr, *dataPtr;
- strcpy(currentCtName, ctName);
+ if (currentCtName != ctName)
+ strcpy(currentCtName, ctName);
ptr = dataPtr = readBundleFile(findFileInBundle(ctName));
@@ -86,7 +87,8 @@ void loadBgHigh(const char *currentPtr) {
byte loadBg(const char *bgName) {
byte *ptr, *dataPtr;
- strcpy(currentBgName[0], bgName);
+ if (currentBgName[0] != bgName)
+ strcpy(currentBgName[0], bgName);
byte fileIdx = findFileInBundle(bgName);
ptr = dataPtr = readBundleFile(fileIdx);
diff --git a/engines/cine/part.cpp b/engines/cine/part.cpp
index c27240169e..b862d72b53 100644
--- a/engines/cine/part.cpp
+++ b/engines/cine/part.cpp
@@ -52,7 +52,8 @@ void loadPart(const char *partName) {
numElementInPart = g_cine->_partFileHandle.readUint16BE();
g_cine->_partFileHandle.readUint16BE(); // entry size
- strcpy(currentPartName, partName);
+ if (currentPartName != partName)
+ strcpy(currentPartName, partName);
for (i = 0; i < numElementInPart; i++) {
g_cine->_partFileHandle.read(partBuffer[i].partName, 14);
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index f33476facf..c9bb672e21 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -2714,7 +2714,7 @@ void addMessage(byte param1, int16 param2, int16 param3, int16 param4, int16 par
currentHead = tempHead->next;
}
- newElement = (overlayHeadElement *) malloc(sizeof(overlayHeadElement));
+ newElement = (overlayHeadElement *)malloc(sizeof(overlayHeadElement));
newElement->next = tempHead->next;
tempHead->next = newElement;