[escher] Correct int comparison issue in text field

Change-Id: Ie70f6e9f0986909e28206747e1d7445f54b30397
This commit is contained in:
Émilie Feral
2016-11-14 09:55:16 +01:00
parent 6d880a0c4c
commit 9e9302b602

View File

@@ -99,7 +99,7 @@ void TextField::appendText(const char * text) {
if (m_currentTextLength + textSize > m_textBufferSize) {
return;
}
for (int k = m_currentTextLength; k > m_currentCursorPosition - 1; k--) {
for (int k = m_currentTextLength; k >= m_currentCursorPosition && k >= 0; k--) {
m_textBuffer[k+textSize] = m_textBuffer[k];
}
strlcpy(&m_textBuffer[m_currentCursorPosition], text, textSize);