Merge "[escher] Fix bug in textfield"

This commit is contained in:
Émilie Feral
2017-02-17 16:33:32 +01:00
committed by Gerrit

View File

@@ -163,7 +163,9 @@ void TextField::insertTextAtLocation(const char * text, int location) {
m_draftTextBuffer[k+textSize] = m_draftTextBuffer[k];
}
strlcpy(&m_draftTextBuffer[location], text, textSize);
m_draftTextBuffer[location+textSize-1] = text[textSize-1];
if (location+textSize > 0) {
m_draftTextBuffer[location+textSize-1] = text[textSize-1];
}
m_currentTextLength += textSize;
reload();
}