diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-02-01 21:08:30 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-02 11:10:04 +0100 |
commit | 4b1ba7c7928b4b326eb83e6df6f0b8fb93f2edf0 (patch) | |
tree | 6bc4d32175683d8f7c1c5fd8bcc9d2b64ee0a39f /src/corelib | |
parent | 7edd623957b958d7d3db20772571810d7be9da85 (diff) |
Fix QString::operator=(QLatin1String) for substrings
QLatin1String now has a constructor that takes explicit length, which
makes it possible to create a QLatin1String that isn't null-terminated.
Made QString::operator=(QLatin1String) work in that case.
Change-Id: Ie77eabd2f8f036531d67cd8051a7b6305b386ccf
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/tools/qstring.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 285369a736..f1bad5c028 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -711,7 +711,7 @@ inline bool QString::isDetached() const { return d->ref == 1; } inline QString &QString::operator=(const QLatin1String &s) { - *this = fromLatin1(s.latin1()); + *this = fromLatin1(s.latin1(), s.size()); return *this; } inline void QString::clear() |