From a6ddae873bbe4c3cc68949f5a2758b5458422e7c Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 10 Oct 2015 10:34:46 +0200 Subject: QtCore: Don't compare QChars to literal 0s This is prone to ambiguities, even though we currently don't run into them. Use QChar::isNull() instead. Change-Id: I71843878b3f4f8a5deae2ef57a6f6628461be216 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/tools/qstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/tools/qstring.cpp') diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index e3a3cc79c6..ea220ed557 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -1509,7 +1509,7 @@ QString::QString(const QChar *unicode, int size) } else { if (size < 0) { size = 0; - while (unicode[size] != 0) + while (!unicode[size].isNull()) ++size; } if (!size) { -- cgit v1.2.3