aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter van Niftrik2009-10-10 13:47:26 +0000
committerWalter van Niftrik2009-10-10 13:47:26 +0000
commitbb381d3a52172bd84c5781111c1a4b7bd8a18a31 (patch)
tree6c3ebb263b24082b2f539ab0444c8933e6d54a81
parenta07c50aba437b283a23d50c4695695189a1f1c5a (diff)
downloadscummvm-rg350-bb381d3a52172bd84c5781111c1a4b7bd8a18a31.tar.gz
scummvm-rg350-bb381d3a52172bd84c5781111c1a4b7bd8a18a31.tar.bz2
scummvm-rg350-bb381d3a52172bd84c5781111c1a4b7bd8a18a31.zip
SCI: Fixed bug in new Message() code
svn-id: r44873
-rw-r--r--engines/sci/engine/message.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/sci/engine/message.cpp b/engines/sci/engine/message.cpp
index 59775d6cef..cfd7de6c46 100644
--- a/engines/sci/engine/message.cpp
+++ b/engines/sci/engine/message.cpp
@@ -231,7 +231,7 @@ int MessageState::messageSize(int module, MessageTuple &t) {
stack.init(module, t);
if (getRecord(stack, true, record))
- return strlen(record.string);
+ return strlen(record.string) + 1;
else
return 0;
}
@@ -365,7 +365,7 @@ Common::String MessageState::processString(const char *s) {
void MessageState::outputString(reg_t buf, const Common::String &str) {
SegmentRef buffer_r = _segMan->dereference(buf);
- if ((unsigned)buffer_r.maxSize >= str.size()) {
+ if ((unsigned)buffer_r.maxSize >= str.size() + 1) {
_segMan->strcpy(buf, str.c_str());
} else {
warning("Message: buffer %04x:%04x invalid or too small to hold the following text of %i bytes: '%s'", PRINT_REG(buf), str.size() + 1, str.c_str());