From 9de6746814beefd32dd7fd6e4336a28cfccaaf3b Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Mon, 15 Aug 2016 20:10:29 +0600 Subject: SCUMM HE: Replace strcpy with strlcpy in array setup setupStringArrayFromString() now uses Common::strlcpy(). --- engines/scumm/he/script_v72he.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines') 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); } -- cgit v1.2.3