From f9e4e7112f0a15aff47babe8d9c2ab1d13341e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 25 Apr 2017 10:11:35 +0200 Subject: [PATCH] [escher] In textField, fix bug (overwriting outside the buffer !!) Change-Id: Id757a967400e9cfe521cbd510eaafc9848853b36 --- escher/src/text_field.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/escher/src/text_field.cpp b/escher/src/text_field.cpp index 9bb4269c7..a6ceb1f8d 100644 --- a/escher/src/text_field.cpp +++ b/escher/src/text_field.cpp @@ -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--) {