[Scummvm-git-logs] scummvm master -> 809dcf12ab354a3ad0da865b10510d476a4212b4

csnover csnover at users.noreply.github.com
Fri Jan 6 20:14:35 CET 2017


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d9b2b7d484 SCI32: Fix a subtle bug in SciArray::trim()
809dcf12ab SCI32: Fix overlapped memory copies in SciString


Commit: d9b2b7d484b5dda3dad91aef20da425897698b84
    https://github.com/scummvm/scummvm/commit/d9b2b7d484b5dda3dad91aef20da425897698b84
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2017-01-06T13:13:21-06:00

Commit Message:
SCI32: Fix a subtle bug in SciArray::trim()

With this bug, whenever a string was trimmed from the right, the last
character was always cut off, even if it wasn't whitespace. This was
apparent in the RAMA demo, which parses a text file for its scenes,
and each line is trimmed

Changed paths:
    engines/sci/engine/segment.h


diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h
index 538f311..81be933 100644
--- a/engines/sci/engine/segment.h
+++ b/engines/sci/engine/segment.h
@@ -810,9 +810,9 @@ public:
 		if (flags & kArrayTrimRight) {
 			source = data + strlen((char *)data) - 1;
 			while (source > data && *source != showChar && *source <= kWhitespaceBoundary) {
+				*source = '\0';
 				--source;
 			}
-			*source = '\0';
 		}
 
 		if (flags & kArrayTrimCenter) {


Commit: 809dcf12ab354a3ad0da865b10510d476a4212b4
    https://github.com/scummvm/scummvm/commit/809dcf12ab354a3ad0da865b10510d476a4212b4
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-01-06T13:13:59-06:00

Commit Message:
SCI32: Fix overlapped memory copies in SciString

Changed paths:
    engines/sci/engine/segment.h


diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h
index 81be933..7e2189e 100644
--- a/engines/sci/engine/segment.h
+++ b/engines/sci/engine/segment.h
@@ -804,7 +804,7 @@ public:
 			while (*source != '\0' && *source != showChar && *source <= kWhitespaceBoundary) {
 				++source;
 			}
-			strcpy((char *)target, (char *)source);
+			memmove(target, source, Common::strnlen((char *)source, _size - 1) + 1);
 		}
 
 		if (flags & kArrayTrimRight) {





More information about the Scummvm-git-logs mailing list