From bf58a0206dc1fd1fd8bedee7543dff7bb2d43787 Mon Sep 17 00:00:00 2001 From: Dominik Szamburski Date: Tue, 10 Sep 2019 19:36:37 +0200 Subject: [PATCH] Fix _vsnprintf on windows (#720) * use _vsnprintf_s on windows --- rehlds/public/tier0/dbg.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rehlds/public/tier0/dbg.h b/rehlds/public/tier0/dbg.h index 9feb4ac..8486b95 100644 --- a/rehlds/public/tier0/dbg.h +++ b/rehlds/public/tier0/dbg.h @@ -422,7 +422,11 @@ public: va_list arg_ptr; va_start(arg_ptr, pszFormat); +#if defined(_WIN32) && !defined(_CRT_SECURE_NO_WARNINGS) + _vsnprintf_s(m_szBuf, sizeof(m_szBuf) - 1, sizeof(m_szBuf) - 1, pszFormat, arg_ptr); +#else _vsnprintf(m_szBuf, sizeof(m_szBuf) - 1, pszFormat, arg_ptr); +#endif va_end(arg_ptr); m_szBuf[sizeof(m_szBuf) - 1] = 0;