summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-07-27 11:06:59 +0300
committerEdward Welbourne <edward.welbourne@qt.io>2019-07-29 12:45:08 +0000
commit93b845464fa7ac29c26e1835fd3a6cfac33d9a9d (patch)
treea6218a8cc69159c75e654d989dab2ef1c58ac08b /src/corelib/tools
parentadab531771a1ddce7df6652449b7977f340ebfc7 (diff)
QStringView: two fixes for newly-added toWCharArray()
Amends e89fbd8c3aa50a24e5fc02ab710ccca67fce98e2. - While QString::data() never returns nullptr, QStringView::data() may, which makes calling QStringView{}.toWCharArray() UB on Windows (since memcpy's 2nd argument must never be nullptr, even if the size is zero). Fix by protecting the memcpy call. - QStringView, by design, does not use out-of-line member functions, because calling these forces the QStringView object onto the stack. Fix by making inline. Also use the more efficient qToStringViewIgnoringNull(), as the result does not depend on QString::isNull() (no characters are written either way), and add a missing article to the function's docs. Change-Id: I5d6b31361522812b0db8303b93c43d4b9ed11933 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/tools')
0 files changed, 0 insertions, 0 deletions