aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise
diff options
context:
space:
mode:
Diffstat (limited to 'engines/cruise')
-rw-r--r--engines/cruise/background.cpp8
-rw-r--r--engines/cruise/background.h2
2 files changed, 7 insertions, 3 deletions
diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp
index e8f0865270..a32973eb54 100644
--- a/engines/cruise/background.cpp
+++ b/engines/cruise/background.cpp
@@ -210,8 +210,12 @@ int loadBackground(const char *name, int idx) {
MemFree(ptrToFree);
- if (name != backgroundTable[idx].name)
- strcpy(backgroundTable[idx].name, name);
+ if (name != backgroundTable[idx].name) {
+ if (strlen(name) > sizeof(backgroundTable[idx].name))
+ warning("background name length exceeded allowable maximum");
+
+ strncpy(backgroundTable[idx].name, name, sizeof(backgroundTable[idx].name));
+ }
return (0);
}
diff --git a/engines/cruise/background.h b/engines/cruise/background.h
index 6f9b89d3f0..caa90bea0f 100644
--- a/engines/cruise/background.h
+++ b/engines/cruise/background.h
@@ -29,7 +29,7 @@
namespace Cruise {
struct backgroundTableStruct {
- char name[9];
+ char name[16];
char extention[6];
};