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:
parent
5fd3539cfd
commit
aaf39bac23
@ -420,7 +420,7 @@ bool qt_splitLocaleName(const QString &name, QString &lang, QString &script, QSt
|
|||||||
state = ScriptState;
|
state = ScriptState;
|
||||||
break;
|
break;
|
||||||
case ScriptState: {
|
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) {
|
if (value.length() == 4 && scripts.indexOf(value) % 4 == 0) {
|
||||||
// script name is always 4 characters
|
// script name is always 4 characters
|
||||||
script = value;
|
script = value;
|
||||||
|
Loading…
Reference in New Issue
Block a user