From 7cbc1b83ef0d35ddd5f8b72a0fa25e14b693ebd2 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Tue, 21 Sep 2021 01:02:07 +0300 Subject: [PATCH] correct qstricmp() return value checks in QTextStreamPrivate::getReal() Signed-off-by: Ivailo Monev --- src/core/io/qtextstream.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/io/qtextstream.cpp b/src/core/io/qtextstream.cpp index 7d6af56cd..114aa05f9 100644 --- a/src/core/io/qtextstream.cpp +++ b/src/core/io/qtextstream.cpp @@ -1856,13 +1856,13 @@ bool QTextStreamPrivate::getReal(double *f) // for some reason. QLocale only checks for lower-case // nan/+inf/-inf, so here we also check for uppercase and mixed // case versions. - if (!qstricmp(buf, "nan") || !qstricmp(buf, "+nan") || !qstricmp(buf, "-nan")) { + if (qstricmp(buf, "nan") == 0 || qstricmp(buf, "+nan") == 0 || qstricmp(buf, "-nan") == 0) { *f = qSNaN(); return true; - } else if (!qstricmp(buf, "+inf") || !qstricmp(buf, "inf")) { + } else if (qstricmp(buf, "+inf") == 0 || qstricmp(buf, "inf") == 0) { *f = qInf(); return true; - } else if (!qstricmp(buf, "-inf")) { + } else if (qstricmp(buf, "-inf") == 0) { *f = -qInf(); return true; } -- 2.11.0