diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2012-01-26 11:13:41 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-26 13:28:16 +0100 |
commit | e62fe9ed4fd8d33f881dedeeafafc4a0c65e5278 (patch) | |
tree | e8148f0ed05f2b1584c483ad87f9f462b78badd1 /src/corelib/json/qjson_p.h | |
parent | 68e5fd9ebc8a3f510e3144e981a0cb358945fb9c (diff) |
Fixed QString::operator<(QLatin1String)
QLatin1String now has a constructor that takes explicit length, which makes it
possible to create QLatin1String that do not have null-termination character.
Fixed QString::operator> and < to be safe in that case.
In the same patch fixed qtjson which had operator< implemented in the same way.
QString::compare(QLatin1String) is still broken and will be fixed separately.
Change-Id: I48ec1183a6f44034129cc17312af854795085408
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/json/qjson_p.h')
-rw-r--r-- | src/corelib/json/qjson_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/json/qjson_p.h b/src/corelib/json/qjson_p.h index 304aa9cc5d..b484148074 100644 --- a/src/corelib/json/qjson_p.h +++ b/src/corelib/json/qjson_p.h @@ -469,7 +469,7 @@ inline bool String::operator<(const Latin1String &str) const ++uc; ++c; } - return (uc == (d->utf16 + d->length) ? *c : (ushort)*uc < *c); + return (uc == e ? (int)d->length < (int)str.d->length : (ushort)*uc < *c); } |