From aaf39bac239d3f2b62933e152d8d5a5f55d0864b Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Thu, 23 Apr 2015 18:24:17 +0200 Subject: [PATCH] QLocale: Exclude null-byte in QString generated from script_code_list. Change-Id: I2b9b85dd052360ea6bd96f18180b1b97cf4daaeb Reviewed-by: Marc Mutz --- src/corelib/tools/qlocale.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;