aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2010-10-15 14:14:33 +0000
committerJohannes Schickel2010-10-15 14:14:33 +0000
commitd221176c47d33618be8ab8f3a81da6384037d751 (patch)
treedb96e45c326ec7d74ef500264deaa450a380e121
parent36d7ec96b926d25942d8e1d768d6b63237e38e86 (diff)
downloadscummvm-rg350-d221176c47d33618be8ab8f3a81da6384037d751.tar.gz
scummvm-rg350-d221176c47d33618be8ab8f3a81da6384037d751.tar.bz2
scummvm-rg350-d221176c47d33618be8ab8f3a81da6384037d751.zip
CRUISE: Replace some strncpy with strlcpy.
svn-id: r53495
-rw-r--r--engines/cruise/background.cpp3
-rw-r--r--engines/cruise/function.cpp2
2 files changed, 2 insertions, 3 deletions
diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp
index 3ac57cc376..edd52d3b4a 100644
--- a/engines/cruise/background.cpp
+++ b/engines/cruise/background.cpp
@@ -216,8 +216,7 @@ int loadBackground(const char *name, int idx) {
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;
+ Common::strlcpy(backgroundTable[idx].name, name, sizeof(backgroundTable[idx].name));
}
return (0);
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp
index 7c8f8af942..c3d435bde6 100644
--- a/engines/cruise/function.cpp
+++ b/engines/cruise/function.cpp
@@ -58,7 +58,7 @@ int16 Op_LoadOverlay() {
updateAllScriptsImports();
- strncpy(nextOverlay, overlayName, 38);
+ Common::strlcpy(nextOverlay, overlayName, sizeof(nextOverlay));
return overlayLoadResult;
}