From fa8f540108fe8df7397d2a6aa279b69bd86aedca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Wed, 24 Nov 2021 23:39:34 +0100 Subject: [PATCH] use str_utf8_stats in CLineInput::Manipulate --- src/game/client/lineinput.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/game/client/lineinput.cpp b/src/game/client/lineinput.cpp index d194cc529..fbaeb10a8 100644 --- a/src/game/client/lineinput.cpp +++ b/src/game/client/lineinput.cpp @@ -65,15 +65,7 @@ int32_t CLineInput::Manipulate(IInput::CEvent Event, char *pStr, int StrMaxSize, // gather string stats int CharCount = 0; int CharSize = 0; - while(Event.m_aText[CharSize]) - { - int NewCharSize = str_utf8_forward(Event.m_aText, CharSize); - if(NewCharSize != CharSize) - { - ++CharCount; - CharSize = NewCharSize; - } - } + str_utf8_stats(Event.m_aText, MAX_SIZE, MAX_CHARS, &CharSize, &CharCount); // add new string if(CharCount)