diff --git a/src/corelib/text/qstringconverter.cpp b/src/corelib/text/qstringconverter.cpp index 511f2d7810e..51a9c8fb914 100644 --- a/src/corelib/text/qstringconverter.cpp +++ b/src/corelib/text/qstringconverter.cpp @@ -1631,8 +1631,7 @@ std::optional QStringConverter::encodingForData(cons } if (arraySize > 2) { - static const char utf8bom[] = "\xef\xbb\xbf"; - if (memcmp(buf, utf8bom, sizeof(utf8bom) - 1) == 0) + if (memcmp(buf, utf8bom, sizeof(utf8bom)) == 0) return QStringConverter::Utf8; }