diff options
author | Milian Wolff <milian.wolff@kdab.com> | 2015-04-23 18:24:17 +0200 |
---|---|---|
committer | Milian Wolff <milian.wolff@kdab.com> | 2015-04-24 10:59:47 +0000 |
commit | aaf39bac239d3f2b62933e152d8d5a5f55d0864b (patch) | |
tree | 481ea029cc9d930b77ff23c012e2bb52c0df5e3d /src/corelib/tools | |
parent | 5fd3539cfd944bb8f7cd2d7ec828dd963aa6505d (diff) |
QLocale: Exclude null-byte in QString generated from script_code_list.
Change-Id: I2b9b85dd052360ea6bd96f18180b1b97cf4daaeb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 40bb9049a7..c2857d40a4 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -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; |