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

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Sun Sep 27 15:05:50 CEST 2009


Revision: 44397
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44397&view=rev
Author:   wjpalenstijn
Date:     2009-09-27 13:05:50 +0000 (Sun, 27 Sep 2009)

Log Message:
-----------
SCI: clear strcpy's dest string if src is invalid.
This fixes moving the plank at the start of KQ6 in Text mode.

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

Modified: scummvm/trunk/engines/sci/engine/seg_manager.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.cpp	2009-09-27 12:23:14 UTC (rev 44396)
+++ scummvm/trunk/engines/sci/engine/seg_manager.cpp	2009-09-27 13:05:50 UTC (rev 44397)
@@ -912,6 +912,10 @@
 	const SegmentRef src_r = dereference(src);
 	if (!src_r.isValid()) {
 		warning("Attempt to strncpy from invalid pointer %04x:%04x", PRINT_REG(src));
+
+		// Clear target string instead.
+		if (n > 0)
+			strcpy(dest, "");
 		return;
 	}
 


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