diff options
Diffstat (limited to 'engines/cruise/background.cpp')
-rw-r--r-- | engines/cruise/background.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp index 38fdd0dc9e..c6229beccc 100644 --- a/engines/cruise/background.cpp +++ b/engines/cruise/background.cpp @@ -211,10 +211,11 @@ int loadBackground(const char *name, int idx) { MemFree(ptrToFree); if (strcmp(name, backgroundTable[idx].name)) { - if (strlen(name) > sizeof(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)); + backgroundTable[idx].name[sizeof(backgroundTable[idx].name) - 1] = 0; } return (0); |