From e62fe9ed4fd8d33f881dedeeafafc4a0c65e5278 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Thu, 26 Jan 2012 11:13:41 +0100 Subject: 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 Reviewed-by: Lars Knoll --- src/corelib/json/qjson_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/json/qjson_p.h') 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); } -- cgit v1.2.3