summaryrefslogtreecommitdiffstats
path: root/src/corelib/json
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2012-01-26 11:13:41 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-26 13:28:16 +0100
commite62fe9ed4fd8d33f881dedeeafafc4a0c65e5278 (patch)
treee8148f0ed05f2b1584c483ad87f9f462b78badd1 /src/corelib/json
parent68e5fd9ebc8a3f510e3144e981a0cb358945fb9c (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')
-rw-r--r--src/corelib/json/qjson_p.h2
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);
}