diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 348276810be..fea5fb00df5 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -2570,7 +2570,8 @@ QString& QString::insert(int i, const QChar *unicode, int size) return *this; const ushort *s = (const ushort *)unicode; - if (s >= d.data() && s < d.data() + d.size) { + const std::less less; + if (!less(s, d.data()) && less(s, d.data() + d.size)) { // Part of me - take a copy ushort *tmp = static_cast(::malloc(size * sizeof(QChar))); Q_CHECK_PTR(tmp);