Skip to content

Commit

Permalink
SCUMM HE: Replace strcpy with strlcpy in array setup
Browse files Browse the repository at this point in the history
setupStringArrayFromString() now uses Common::strlcpy().
  • Loading branch information
Tkachov authored and sev- committed Aug 30, 2016
1 parent 3c64e49 commit 9de6746
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engines/scumm/he/script_v72he.cpp
Expand Up @@ -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);
}
Expand Down

0 comments on commit 9de6746

Please sign in to comment.