aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorAlexander Tkachev2016-08-15 20:10:29 +0600
committerEugene Sandulenko2016-08-30 23:26:29 +0200
commit9de6746814beefd32dd7fd6e4336a28cfccaaf3b (patch)
tree8a50f42100156cc68f79b4038b3cb60aa648b0e3 /engines
parent3c64e4958dd6920644a568e0ea38e4e7edd43b71 (diff)
downloadscummvm-rg350-9de6746814beefd32dd7fd6e4336a28cfccaaf3b.tar.gz
scummvm-rg350-9de6746814beefd32dd7fd6e4336a28cfccaaf3b.tar.bz2
scummvm-rg350-9de6746814beefd32dd7fd6e4336a28cfccaaf3b.zip
SCUMM HE: Replace strcpy with strlcpy in array setup
setupStringArrayFromString() now uses Common::strlcpy().
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/he/script_v72he.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index 4385475a30..c764de7da1 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -239,10 +239,10 @@ int ScummEngine_v72he::setupStringArrayFromString(char *cStr) {
writeVar(0, 0);
- int len = strlen(cStr);
+ int len = strlen(cStr) + 1;
byte *ptr = defineArray(0, kStringArray, 0, 0, 0, len);
if (ptr != nullptr)
- strcpy((char*)ptr, cStr);
+ Common::strlcpy((char*)ptr, cStr, len);
return readVar(0);
}