[escher] Fix bug in text field: casting a unsigned char to signed char give negative

values above 127...
This commit is contained in:
Émilie Feral
2018-05-16 14:31:42 +02:00
committed by LeaNumworks
parent 67185e6d26
commit 2e0a70f269

View File

@@ -123,7 +123,7 @@ bool TextField::ContentView::removeChar() {
if( m_horizontalAlignment == 0.0f) {
reloadRectFromCursorPosition(cursorLocation());
}
for (int k = cursorLocation(); k < (signed char)m_currentDraftTextLength; k ++) {
for (size_t k = cursorLocation(); k < m_currentDraftTextLength; k++) {
m_draftTextBuffer[k] = m_draftTextBuffer[k+1];
}
m_draftTextBuffer[m_currentDraftTextLength] = 0;