use str_utf8_stats in CLineInput::Manipulate

This commit is contained in:
Robert Müller 2021-11-24 23:39:34 +01:00
parent 5cf356229b
commit fa8f540108

View file

@ -65,15 +65,7 @@ int32_t CLineInput::Manipulate(IInput::CEvent Event, char *pStr, int StrMaxSize,
// gather string stats // gather string stats
int CharCount = 0; int CharCount = 0;
int CharSize = 0; int CharSize = 0;
while(Event.m_aText[CharSize]) str_utf8_stats(Event.m_aText, MAX_SIZE, MAX_CHARS, &CharSize, &CharCount);
{
int NewCharSize = str_utf8_forward(Event.m_aText, CharSize);
if(NewCharSize != CharSize)
{
++CharCount;
CharSize = NewCharSize;
}
}
// add new string // add new string
if(CharCount) if(CharCount)