mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
use str_utf8_stats in CLineInput::Manipulate
This commit is contained in:
parent
5cf356229b
commit
fa8f540108
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue