[Scummvm-git-logs] scummvm master -> 7ba35924a4b7fd3ab8648cb9ff8ca34b7782852c

sev- sev at scummvm.org
Sun Mar 14 18:07:34 UTC 2021


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

Summary:
7ba35924a4 MYST3: Don't let getTextData() add extra string terminators


Commit: 7ba35924a4b7fd3ab8648cb9ff8ca34b7782852c
    https://github.com/scummvm/scummvm/commit/7ba35924a4b7fd3ab8648cb9ff8ca34b7782852c
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2021-03-14T19:07:32+01:00

Commit Message:
MYST3: Don't let getTextData() add extra string terminators

Recently, the String class was modified to not allow appending
terminators to a string. This was done to fix a Myst III
regression, though apparently the Stark engine was also
impacted somehow?

The aim of this change is to not append terminators to the string,
to ensure that it will keep working regardless of how the String
class handles it.

Changed paths:
    engines/myst3/archive.cpp


diff --git a/engines/myst3/archive.cpp b/engines/myst3/archive.cpp
index cbaaeb59d1..1727d0bc64 100644
--- a/engines/myst3/archive.cpp
+++ b/engines/myst3/archive.cpp
@@ -286,17 +286,14 @@ Common::String ResourceDescription::getTextData(uint index) const {
 	// extract the wanted one
 	cnt = 0;
 	int i = 0;
-	Common::String text;
-	while (cnt <= index && i < 89) {
-		if (cnt == index)
-			text += decrypted[i];
-
+	while (cnt < index) {
 		if (!decrypted[i])
 			cnt++;
 
 		i++;
 	}
 
+	Common::String text((const char *)&decrypted[i]);
 	return text;
 }
 




More information about the Scummvm-git-logs mailing list