From e99bbda7347d35833da0876bc745d5e0b6c18c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Tue, 22 Mar 2022 13:26:31 +0100 Subject: [PATCH] Use empty d->cString for TQString::shared_null instead of null string. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This restores consistency for the behavior of methods TQString::utf8() and TQString::local8Bit() with null TQStrings. Signed-off-by: Slávek Banko --- src/tools/qstring.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/qstring.cpp b/src/tools/qstring.cpp index 3986ecf..f9f3faa 100644 --- a/src/tools/qstring.cpp +++ b/src/tools/qstring.cpp @@ -6000,7 +6000,7 @@ void QString::setSecurityUnPaged(bool lock) { QCString QString::utf8() const { if (!d->cString) { - d->cString = new QCString; + d->cString = new QCString(""); } if(d == shared_null) { @@ -6254,7 +6254,7 @@ QString QString::fromLatin1( const char* chars, int len ) QCString QString::local8Bit() const { if (!d->cString) { - d->cString = new QCString; + d->cString = new QCString(""); } if(d == shared_null) {