[Scummvm-git-logs] scummvm master -> ab06f27d4349741945c3d0763a717c118a9e1cbc

eriktorbjorn eriktorbjorn at telia.com
Tue Jun 29 11:37:20 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:
ab06f27d43 COMMON: Add warning when adding \0 to a String


Commit: ab06f27d4349741945c3d0763a717c118a9e1cbc
    https://github.com/scummvm/scummvm/commit/ab06f27d4349741945c3d0763a717c118a9e1cbc
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2021-06-29T13:37:05+02:00

Commit Message:
COMMON: Add warning when adding \0 to a String

Some engines do this, and it's not really known what should happen. We
need to decide on a behavior, and stick to that. This warning is to help
find where it happens.

>From my own tests, it can happen in at least ADL, Avalanche, Chewy,
Director, Blazing Dragons, MacVenture, MADS, Prince, Stark, Startrek,
and Trecision. Only ADL is known to be broken by the current behavior.

The result of my test can be found at
http://www.update.uu.se/~d91tan/tmp/string.txt

Changed paths:
    common/base-str.cpp


diff --git a/common/base-str.cpp b/common/base-str.cpp
index 9aa166225a..5389c912a5 100644
--- a/common/base-str.cpp
+++ b/common/base-str.cpp
@@ -723,8 +723,10 @@ TEMPLATE void BASESTRING::trim() {
 #endif
 
 TEMPLATE void BASESTRING::assignAppend(value_type c) {
-	if (c == 0)
+	if (c == 0) {
+		warning("Adding \\0 to String is currently not well defined");
 		return;
+	}
 	ensureCapacity(_size + 1, true);
 
 	_str[_size++] = c;




More information about the Scummvm-git-logs mailing list