From d059d5c3cb9dddcc55cf5291cd1b7222169d105b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Thu, 15 Feb 2024 13:42:24 +0100 Subject: [PATCH] QLocal8Bit::convertFromUnicode[win]: limit fprintf to !NDEBUG Because there is no other way to stop it from printing the output. Pick-to: 6.6 6.5 Change-Id: Ie6dcb393351f50691366849ba85d60e2e186f9fb Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira (cherry picked from commit 1dd89bfb04515bd2e431f8915256a417d622288f) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/text/qstringconverter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/text/qstringconverter.cpp b/src/corelib/text/qstringconverter.cpp index 207afdc1da6..f694b4290d7 100644 --- a/src/corelib/text/qstringconverter.cpp +++ b/src/corelib/text/qstringconverter.cpp @@ -1555,9 +1555,11 @@ QByteArray QLocal8Bit::convertFromUnicode_sys(QStringView in, quint32 codePage, // incomplete sequence, probably a Windows bug. We try to avoid that from // happening by reducing the window size in that case. But let's keep this // branch just in case of other bugs. +#ifndef QT_NO_DEBUG r = GetLastError(); fprintf(stderr, "WideCharToMultiByte: Cannot convert multibyte text (error %d)\n", r); +#endif // !QT_NO_DEBUG break; } std::tie(out, outlen) = growOut(neededLength);