KTar's unittests detected a behavior change in Qt.
Thiago, is it intentional, or should it be fixed in Qt ?

KTar does

QString name = QFile::decodeName(QByteArray(buffer, 100));

where buffer is e.g. "filename\0\0\0\0\0\0[...]"

With Qt < 5.6 this would lead to name being equal to "filename".

With Qt 5.6 from git, it leads to name being equal to "filename\0\0\0\0\0etc.".

It appears that QUtfCodec doesn't stop at the first null byte anymore.

This appears to fix it:
-        name = QFile::decodeName(QByteArray(buffer, 100));
+        name = QFile::decodeName(QByteArray(buffer, qstrnlen(buffer, 100)));

but I have to find the other places in there, some more unittests still fail.

-- 
David Faure, fa...@kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5

_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel

Reply via email to