diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-08-27 15:25:26 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-08-30 17:46:00 +0200 |
commit | 7d33779a795afb54af1a96c0da93b532f9db3ba2 (patch) | |
tree | a760a2777d752fba7f91135ae7b80d37750d5745 /src/corelib/text/qlocale_win.cpp | |
parent | 5644af6f8a800a1516360a42ba4c1a8dc61fc516 (diff) |
Convert various callers of strtou?ll() to call strntou?ll()
Where size is known or can readily be determined.
Change-Id: I442e7ebb3757fdbf7d021a15e19aeba533b590a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/text/qlocale_win.cpp')
-rw-r--r-- | src/corelib/text/qlocale_win.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/text/qlocale_win.cpp b/src/corelib/text/qlocale_win.cpp index bfb20538eb..1dd7a1532e 100644 --- a/src/corelib/text/qlocale_win.cpp +++ b/src/corelib/text/qlocale_win.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** @@ -982,7 +982,7 @@ static QString winIso639LangName(LCID id) const char *endptr; bool ok; QByteArray latin1_lang_code = std::move(lang_code).toLatin1(); - int i = qstrtoull(latin1_lang_code, &endptr, 16, &ok); + int i = qstrntoull(latin1_lang_code.data(), latin1_lang_code.size(), &endptr, 16, &ok); if (ok && *endptr == '\0') { switch (i) { case 0x814: @@ -1024,7 +1024,7 @@ static QByteArray getWinLocaleName(LCID id) if (result == "C" || (!result.isEmpty() && qt_splitLocaleName(QString::fromLocal8Bit(result)))) { bool ok = false; // See if we have a Windows locale code instead of a locale name: - long id = qstrtoll(result.data(), 0, 0, &ok); + long id = qstrntoll(result.data(), result.size(), 0, 0, &ok); if (!ok || id == 0 || id < INT_MIN || id > INT_MAX) // Assume real locale name return result; return winLangCodeToIsoName(int(id)); |