diff options
Diffstat (limited to 'src/corelib/text/qbytearraymatcher.h')
-rw-r--r-- | src/corelib/text/qbytearraymatcher.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/text/qbytearraymatcher.h b/src/corelib/text/qbytearraymatcher.h index 0eedfc1d20..54a385d6b3 100644 --- a/src/corelib/text/qbytearraymatcher.h +++ b/src/corelib/text/qbytearraymatcher.h @@ -42,6 +42,8 @@ #include <QtCore/qbytearray.h> +#include <limits> + QT_BEGIN_NAMESPACE @@ -138,6 +140,7 @@ template <uint N> class QStaticByteArrayMatcher : QStaticByteArrayMatcherBase { char m_pattern[N]; + // N includes the terminating '\0'! Q_STATIC_ASSERT_X(N > 2, "QStaticByteArrayMatcher makes no sense for finding a single-char pattern"); public: explicit Q_DECL_RELAXED_CONSTEXPR QStaticByteArrayMatcher(const char (&patternToMatch)[N]) noexcept |