QLocale: Exclude null-byte in QString generated from script_code_list.

Change-Id: I2b9b85dd052360ea6bd96f18180b1b97cf4daaeb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
Milian Wolff 2015-04-23 18:24:17 +02:00
parent 5fd3539cfd
commit aaf39bac23

View File

@ -420,7 +420,7 @@ bool qt_splitLocaleName(const QString &name, QString &lang, QString &script, QSt
state = ScriptState;
break;
case ScriptState: {
QString scripts = QString::fromLatin1((const char *)script_code_list, sizeof(script_code_list));
QString scripts = QString::fromLatin1((const char *)script_code_list, sizeof(script_code_list) - 1);
if (value.length() == 4 && scripts.indexOf(value) % 4 == 0) {
// script name is always 4 characters
script = value;