From 54b0b4ac4cd4a42de660ea426edb27840ddfd4f0 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 3 Nov 2020 11:19:20 +0100 Subject: [PATCH] COMMON: Restore old behaviour for appending char to string Appending \0 to string and expecting it to be just dropped is still an invalid behaviour but it already happened in 2 engines, so restore old behaviour, at least for now --- common/base-str.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/base-str.cpp b/common/base-str.cpp index 0566821420e..2439c2931a1 100644 --- a/common/base-str.cpp +++ b/common/base-str.cpp @@ -731,6 +731,8 @@ TEMPLATE void BASESTRING::trim() { #endif TEMPLATE void BASESTRING::assignAppend(value_type c) { + if (c == 0) + return; ensureCapacity(_size + 1, true); _str[_size++] = c;