[Scummvm-cvs-logs] SF.net SVN: scummvm:[44873] scummvm/trunk/engines/sci/engine/message.cpp

waltervn at users.sourceforge.net waltervn at users.sourceforge.net
Sat Oct 10 15:47:26 CEST 2009


Revision: 44873
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44873&view=rev
Author:   waltervn
Date:     2009-10-10 13:47:26 +0000 (Sat, 10 Oct 2009)

Log Message:
-----------
SCI: Fixed bug in new Message() code

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/message.cpp

Modified: scummvm/trunk/engines/sci/engine/message.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/message.cpp	2009-10-10 12:58:40 UTC (rev 44872)
+++ scummvm/trunk/engines/sci/engine/message.cpp	2009-10-10 13:47:26 UTC (rev 44873)
@@ -231,7 +231,7 @@
 
 	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 @@
 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());


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list