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
This commit is contained in:
Dennis Felsing 2022-06-24 16:46:55 +02:00
parent 911e5e1de2
commit 8933ae8357

View file

@ -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++;