diff --git a/src/corelib/text/qstringconverter.cpp b/src/corelib/text/qstringconverter.cpp index 09ac6512be..f0c7b6ce86 100644 --- a/src/corelib/text/qstringconverter.cpp +++ b/src/corelib/text/qstringconverter.cpp @@ -1027,8 +1027,7 @@ QByteArray QUtf32::convertFromUnicode(QStringView in, QStringConverter::State *s length += 4; QByteArray ba(length, Qt::Uninitialized); char *end = convertFromUnicode(ba.data(), in, state, endian); - Q_ASSERT(end - ba.constData() == length); - Q_UNUSED(end); + ba.truncate(end - ba.constData()); return ba; }