[escher] In textField, fix bug (overwriting outside the buffer !!)

Change-Id: Id757a967400e9cfe521cbd510eaafc9848853b36
This commit is contained in:
Émilie Feral
2017-04-25 10:11:35 +02:00
parent 11fc821282
commit f9e4e7112f

View File

@@ -127,7 +127,7 @@ void TextField::ContentView::setCursorLocation(int location) {
void TextField::ContentView::insertTextAtLocation(const char * text, int location) {
int textSize = strlen(text);
if (m_currentTextLength + textSize > m_textBufferSize) {
if (m_currentTextLength + textSize >= m_textBufferSize) {
return;
}
for (int k = m_currentTextLength; k >= location && k >= 0; k--) {