aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/cruise/linker.cpp8
-rw-r--r--engines/cruise/overlay.cpp12
2 files changed, 9 insertions, 11 deletions
diff --git a/engines/cruise/linker.cpp b/engines/cruise/linker.cpp
index cb750b0ed2..883bad97d3 100644
--- a/engines/cruise/linker.cpp
+++ b/engines/cruise/linker.cpp
@@ -40,18 +40,18 @@ exportEntryStruct *parseExport(int *out1, int *pExportedFuncionIdx, char *buffer
*out1 = 0;
*pExportedFuncionIdx = 0;
- strcpy(localBuffer, buffer);
+ Common::strlcpy(localBuffer, buffer, sizeof(localBuffer));
dotPtr = strchr(localBuffer, '.');
if (dotPtr) {
- strcpy(functionName, dotPtr + 1);
+ Common::strlcpy(functionName, dotPtr + 1, sizeof(functionName));
*dotPtr = 0;
strcpy(overlayName, localBuffer);
} else {
overlayName[0] = 0;
- strcpy(functionName, buffer);
+ Common::strlcpy(functionName, buffer, sizeof(functionName));
}
ptr2 = strchr((char *)functionName, ':');
@@ -89,7 +89,7 @@ exportEntryStruct *parseExport(int *out1, int *pExportedFuncionIdx, char *buffer
char exportedName[256];
char *name = entity1Name + currentExportEntry->offsetToName;
- strcpy(exportedName, name);
+ Common::strlcpy(exportedName, name, sizeof(exportedName));
strToUpper(exportedName);
if (!strcmp(functionName, exportedName)) {
diff --git a/engines/cruise/overlay.cpp b/engines/cruise/overlay.cpp
index 61df716742..d2cc0f671b 100644
--- a/engines/cruise/overlay.cpp
+++ b/engines/cruise/overlay.cpp
@@ -159,7 +159,7 @@ int loadOverlay(const char *scriptName) {
return (-2);
if (scriptName != overlayTable[scriptIdx].overlayName)
- strcpy(overlayTable[scriptIdx].overlayName, scriptName);
+ Common::strlcpy(overlayTable[scriptIdx].overlayName, scriptName, sizeof(overlayTable[scriptIdx].overlayName));
overlayTable[scriptIdx].alreadyLoaded = 1;
@@ -167,9 +167,8 @@ int loadOverlay(const char *scriptName) {
overlayTable[scriptIdx].ovlData->scriptNumber = scriptIdx;
- strcpy(fileName, scriptName);
-
- strcat(fileName, ".OVL");
+ Common::strlcpy(fileName, scriptName, sizeof(fileName));
+ Common::strlcat(fileName, ".OVL", sizeof(fileName));
debug(1, "Attempting to load overlay file %s...", fileName);
@@ -550,9 +549,8 @@ int loadOverlay(const char *scriptName) {
//uint8 fileName[50];
//char* unpackedBuffer;
- strcpy(fileName, scriptName);
-
- strcat(fileName, ".FR");
+ Common::strlcpy(fileName, scriptName, sizeof(fileName));
+ Common::strlcat(fileName, ".FR", sizeof(fileName));
fileIdx = findFileInDisks(fileName);