aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/scumm.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2008-11-15 14:15:17 +0000
committerJohannes Schickel2008-11-15 14:15:17 +0000
commit28bd3e0af8e2f545d57648b8fe991767fe2b5abe (patch)
tree70bf86ce8a0c39ec43c5c81a13b7d35108624793 /engines/scumm/scumm.cpp
parent3a3698f960608e8777620c9e454d6ed2282a036d (diff)
downloadscummvm-rg350-28bd3e0af8e2f545d57648b8fe991767fe2b5abe.tar.gz
scummvm-rg350-28bd3e0af8e2f545d57648b8fe991767fe2b5abe.tar.bz2
scummvm-rg350-28bd3e0af8e2f545d57648b8fe991767fe2b5abe.zip
Fixed strncpy usage.
svn-id: r35083
Diffstat (limited to 'engines/scumm/scumm.cpp')
-rw-r--r--engines/scumm/scumm.cpp4
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';
}
}