diff --git a/src/corelib/io/qipaddress.cpp b/src/corelib/io/qipaddress.cpp index 93a74ccd098..911d1a54b94 100644 --- a/src/corelib/io/qipaddress.cpp +++ b/src/corelib/io/qipaddress.cpp @@ -115,10 +115,8 @@ static bool parseIp4Internal(IPv4Address &address, const char *ptr, bool acceptL } address |= x; - if (dotCount == 3 && *endptr != '\0') - return false; - else if (dotCount == 3 || *endptr == '\0') - return true; + if (dotCount == 3 || *endptr == '\0') + return *endptr == '\0'; if (*endptr != '.') return false; diff --git a/src/corelib/tools/qversionnumber.cpp b/src/corelib/tools/qversionnumber.cpp index 1d05fdd89c0..466a8cc64e8 100644 --- a/src/corelib/tools/qversionnumber.cpp +++ b/src/corelib/tools/qversionnumber.cpp @@ -452,7 +452,7 @@ static QVersionNumber from_string(QLatin1String string, qsizetype *suffixIndex) seg.append(int(value)); start = end + 1; lastGoodEnd = end; - } while (start < endOfString && (end < endOfString && *end == '.')); + } while (start < endOfString && end < endOfString && *end == '.'); if (suffixIndex) *suffixIndex = lastGoodEnd - string.begin();