From 8933ae8357602ae7633996cba3336bb349fcdcbf Mon Sep 17 00:00:00 2001 From: Dennis Felsing Date: Fri, 24 Jun 2022 16:46:55 +0200 Subject: [PATCH] Try to fix dump_local_console (fixes #5488) Untested, but my hunch is that by not cutting off the last part the text file will be correctly recognized as valid utf8 --- src/game/client/components/console.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/client/components/console.cpp b/src/game/client/components/console.cpp index aabe60245..629b48add 100644 --- a/src/game/client/components/console.cpp +++ b/src/game/client/components/console.cpp @@ -285,7 +285,7 @@ void CGameConsole::CInstance::OnInput(IInput::CEvent Event) if(m_Type == CONSOLETYPE_LOCAL || m_pGameConsole->Client()->RconAuthed()) { char *pEntry = m_History.Allocate(m_Input.GetLength() + 1); - mem_copy(pEntry, m_Input.GetString(), m_Input.GetLength() + 1); + str_copy(pEntry, m_Input.GetString(), m_Input.GetLength()); } ExecuteLine(m_Input.GetString()); m_Input.Clear(); @@ -425,7 +425,7 @@ void CGameConsole::CInstance::PrintLine(const char *pLine, int Len, ColorRGBA Pr CBacklogEntry *pEntry = m_Backlog.Allocate(sizeof(CBacklogEntry) + Len); pEntry->m_YOffset = -1.0f; pEntry->m_PrintColor = PrintColor; - mem_copy(pEntry->m_aText, pLine, Len); + str_copy(pEntry->m_aText, pLine, Len); pEntry->m_aText[Len] = 0; if(m_pGameConsole->m_ConsoleType == m_Type) m_pGameConsole->m_NewLineCounter++;