From 42fd0fadfae4c2cbe3ac888887354b7f9f3db7ea Mon Sep 17 00:00:00 2001 From: s1lentq Date: Mon, 22 Mar 2021 23:56:12 +0700 Subject: [PATCH] ExecuteString: Fix parser Closes #821 --- rehlds/HLTV/Console/src/System.cpp | 3 ++- rehlds/engine/SystemWrapper.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rehlds/HLTV/Console/src/System.cpp b/rehlds/HLTV/Console/src/System.cpp index e6a5437..9a20fee 100644 --- a/rehlds/HLTV/Console/src/System.cpp +++ b/rehlds/HLTV/Console/src/System.cpp @@ -173,7 +173,7 @@ void System::ExecuteString(const char *commands) unsigned int i; for (i = 0; i < ARRAYSIZE(singleCmd); i++) { - const char c = *pszSource++; + const char c = *pszSource; if (c == '"') { @@ -186,6 +186,7 @@ void System::ExecuteString(const char *commands) } *pszDest++ = c; + pszSource++; } if (i >= ARRAYSIZE(singleCmd)) diff --git a/rehlds/engine/SystemWrapper.cpp b/rehlds/engine/SystemWrapper.cpp index 5b059b7..f20168f 100644 --- a/rehlds/engine/SystemWrapper.cpp +++ b/rehlds/engine/SystemWrapper.cpp @@ -572,7 +572,7 @@ void SystemWrapper::ExecuteString(const char *commands) unsigned int i; for (i = 0; i < ARRAYSIZE(singleCmd); i++) { - const char c = *pszSource++; + const char c = *pszSource; if (c == '"') { @@ -585,6 +585,7 @@ void SystemWrapper::ExecuteString(const char *commands) } *pszDest++ = c; + pszSource++; } if (i >= ARRAYSIZE(singleCmd))