From 976d6564bcba0bb0936d29d52023321ba89aeb08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Andersson?= Date: Tue, 13 Jul 2021 10:27:59 +0200 Subject: [PATCH] COMMON: Allow \0 to be appended to Strings This has been discussed on the mailing list. While there wasn't much input, the consensus was that it should be allowed for consistency with std::string. While most engines don't do this, it is possible that some engines will break because of it. (A few have already been fixed.) But it will also repear the currently broken ADL engine. For now, the warning() message will remain so that it can be investigated on a case-by-case basis. --- common/base-str.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/base-str.cpp b/common/base-str.cpp index 6c1a80d53dd..cbe38eb9bea 100644 --- a/common/base-str.cpp +++ b/common/base-str.cpp @@ -726,9 +726,8 @@ TEMPLATE void BASESTRING::trim() { TEMPLATE void BASESTRING::assignAppend(value_type c) { if (c == 0) { #ifndef SCUMMVM_UTIL - warning("Adding \\0 to String is currently not well defined"); + warning("Adding \\0 to String. This is permitted, but can have unwanted consequences. (This warning will be removed later.)"); #endif - return; } ensureCapacity(_size + 1, true);