diff --git a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp index d1bea9af23f..58c91eca9f0 100644 --- a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp +++ b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp @@ -111,7 +111,7 @@ bool QComposeInputContext::filterEvent(const QEvent *event) keysym = keyEvent->nativeVirtualKey(); int nCompose = 0; - while (m_composeBuffer[nCompose] != 0 && nCompose < QT_KEYSEQUENCE_MAX_LEN) + while (nCompose < QT_KEYSEQUENCE_MAX_LEN && m_composeBuffer[nCompose] != 0) nCompose++; if (nCompose == QT_KEYSEQUENCE_MAX_LEN) { diff --git a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h index bdf5a913351..898eafd7863 100644 --- a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h +++ b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h @@ -68,7 +68,7 @@ protected: private: QObject *m_focusObject; QVector m_composeTable; - uint m_composeBuffer[QT_KEYSEQUENCE_MAX_LEN + 1]; + uint m_composeBuffer[QT_KEYSEQUENCE_MAX_LEN]; TableGenerator::TableState m_tableState; bool m_compositionTableInitialized; };