From 59deb42252cfe9b999c3991db88f678ca607ea58 Mon Sep 17 00:00:00 2001 From: Alexander Akulich Date: Sun, 10 Jan 2021 18:01:15 +0300 Subject: [PATCH] CConfig: Use str_escape in EscapeParam() --- src/engine/shared/config.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/engine/shared/config.cpp b/src/engine/shared/config.cpp index bc56c1f2e..abebe0481 100644 --- a/src/engine/shared/config.cpp +++ b/src/engine/shared/config.cpp @@ -7,15 +7,9 @@ CConfig g_Config; -void EscapeParam(char *pDst, const char *pSrc, int size) +void EscapeParam(char *pDst, const char *pSrc, int Size) { - for(int i = 0; *pSrc && i < size - 1; ++i) - { - if(*pSrc == '"' || *pSrc == '\\') // escape \ and " - *pDst++ = '\\'; - *pDst++ = *pSrc++; - } - *pDst = 0; + str_escape(&pDst, pSrc, pDst + Size); } CConfigManager::CConfigManager()