diff options
Diffstat (limited to 'engines/scumm')
-rw-r--r-- | engines/scumm/scumm.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 93605fa29b..ddae3141c4 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -2343,7 +2343,9 @@ void ScummEngine::errorString(const char *buf1, char *buf2, int buf2Size) { snprintf(buf2, buf2Size, "(%d:%d:0x%lX): %s", _roomResource, vm.slot[_currentScript].number, (long)(_scriptPointer - _scriptOrgPointer), buf1); } else { - strcpy(buf2, buf1); + strncpy(buf2, buf1, buf2Size); + if (buf2Size > 0) + buf2[buf2Size-1] = '\0'; } } |