Fix IME issue (fixes #4888)

by terminating string instead of assuming that rest of chars are \0,
which was just luckily true before.
This commit is contained in:
Dennis Felsing 2022-03-31 12:44:49 +02:00
parent 2c1dfb3684
commit 27488f042f

View file

@ -70,6 +70,7 @@ void CLineInput::Editing(const char *pString, int Cursor)
m_aDisplayStr[i + FillCharLen] = m_aDisplayStr[i];
for(int i = 0; i < FillCharLen; i++)
m_aDisplayStr[m_CursorPos + i] = aEditingText[i];
m_aDisplayStr[m_CursorPos + FillCharLen] = '\0';
m_FakeLen = str_length(m_aDisplayStr);
m_FakeCursorPos = m_CursorPos + Cursor + 1;
}