From 45d33c6b9785a333e401d3803abd3ccd28b5d105 Mon Sep 17 00:00:00 2001 From: nillerusr Date: Wed, 17 Aug 2022 13:35:55 +0300 Subject: [PATCH] tier1: fix commandbuffer unitialized boolean --- public/tier1/CommandBuffer.h | 1 - tier1/commandbuffer.cpp | 3 +-- tier1/utlstring.cpp | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/public/tier1/CommandBuffer.h b/public/tier1/CommandBuffer.h index d7f842f5..9c765107 100644 --- a/public/tier1/CommandBuffer.h +++ b/public/tier1/CommandBuffer.h @@ -119,7 +119,6 @@ private: bool ParseArgV0( CUtlBuffer &buf, char *pArgv0, int nMaxLen, const char **pArgs ); char m_pArgSBuffer[ ARGS_BUFFER_LENGTH ]; - int m_nLastUsedArgSSize; int m_nArgSBufferSize; CUtlFixedLinkedList< Command_t > m_Commands; int m_nCurrentTick; diff --git a/tier1/commandbuffer.cpp b/tier1/commandbuffer.cpp index adb3ede0..028ea121 100644 --- a/tier1/commandbuffer.cpp +++ b/tier1/commandbuffer.cpp @@ -37,6 +37,7 @@ CCommandBuffer::CCommandBuffer( ) : m_Commands( 32, 32 ) m_nArgSBufferSize = 0; m_bIsProcessingCommands = false; m_nMaxArgSBufferLength = ARGS_BUFFER_LENGTH; + m_bWaitEnabled = true; } CCommandBuffer::~CCommandBuffer() @@ -395,10 +396,8 @@ void CCommandBuffer::EndProcessingCommands() break; AssertMsgOnce( false, "CCommandBuffer::EndProcessingCommands() called before all appropriate commands were dequeued.\n" ); - int nNext = i; Msg( "Warning: Skipping command %s\n", &m_pArgSBuffer[ m_Commands[i].m_nFirstArgS ] ); m_Commands.Remove( i ); - i = nNext; } Compact(); diff --git a/tier1/utlstring.cpp b/tier1/utlstring.cpp index 570aab85..6a13daca 100644 --- a/tier1/utlstring.cpp +++ b/tier1/utlstring.cpp @@ -426,7 +426,7 @@ void CUtlString::TrimLeft( char cTarget ) // We have some whitespace to remove if ( nIndex > 0 ) { - memcpy( m_pString, &m_pString[nIndex], Length() - nIndex ); + memmove( m_pString, &m_pString[nIndex], Length() - nIndex ); SetLength( Length() - nIndex ); } } @@ -463,7 +463,7 @@ void CUtlString::TrimLeft( const char *szTargets ) // We have some whitespace to remove if ( i > 0 ) { - memcpy( m_pString, &m_pString[i], Length() - i ); + memmove( m_pString, &m_pString[i], Length() - i ); SetLength( Length() - i ); } }