From 6161c6d4d834f1eac22b1e16aad86ab5ecf6971b Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 4 Mar 2018 00:24:54 +0300 Subject: [PATCH] Replace snprintf by _snprintf, for MSVC --- cl_dll/text_message.cpp | 8 ++++---- dlls/client.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cl_dll/text_message.cpp b/cl_dll/text_message.cpp index b959fc87..512623dd 100644 --- a/cl_dll/text_message.cpp +++ b/cl_dll/text_message.cpp @@ -181,20 +181,20 @@ int CHudTextMessage::MsgFunc_TextMsg( const char *pszName, int iSize, void *pbuf switch( msg_dest ) { case HUD_PRINTCENTER: - snprintf( psz, MSG_BUF_SIZE, szBuf[0], szBuf[1], szBuf[2], szBuf[3], szBuf[4] ); + _snprintf( psz, MSG_BUF_SIZE, szBuf[0], szBuf[1], szBuf[2], szBuf[3], szBuf[4] ); CenterPrint( ConvertCRtoNL( psz ) ); break; case HUD_PRINTNOTIFY: psz[0] = 1; // mark this message to go into the notify buffer - snprintf( psz + 1, MSG_BUF_SIZE - 1, szBuf[0], szBuf[1], szBuf[2], szBuf[3], szBuf[4] ); + _snprintf( psz + 1, MSG_BUF_SIZE - 1, szBuf[0], szBuf[1], szBuf[2], szBuf[3], szBuf[4] ); ConsolePrint( ConvertCRtoNL( psz ) ); break; case HUD_PRINTTALK: - snprintf( psz, MSG_BUF_SIZE, szBuf[0], szBuf[1], szBuf[2], szBuf[3], szBuf[4] ); + _snprintf( psz, MSG_BUF_SIZE, szBuf[0], szBuf[1], szBuf[2], szBuf[3], szBuf[4] ); gHUD.m_SayText.SayTextPrint( ConvertCRtoNL( psz ), MSG_BUF_SIZE ); break; case HUD_PRINTCONSOLE: - snprintf( psz, MSG_BUF_SIZE, szBuf[0], szBuf[1], szBuf[2], szBuf[3], szBuf[4] ); + _snprintf( psz, MSG_BUF_SIZE, szBuf[0], szBuf[1], szBuf[2], szBuf[3], szBuf[4] ); ConsolePrint( ConvertCRtoNL( psz ) ); break; } diff --git a/dlls/client.cpp b/dlls/client.cpp index 578534e3..1e7dab72 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -108,7 +108,7 @@ void ClientDisconnect( edict_t *pEntity ) char text[256] = ""; if( pEntity->v.netname ) - snprintf( text, sizeof(text), "- %s has left the game\n", STRING( pEntity->v.netname ) ); + _snprintf( text, sizeof(text), "- %s has left the game\n", STRING( pEntity->v.netname ) ); MESSAGE_BEGIN( MSG_ALL, gmsgSayText, NULL ); WRITE_BYTE( ENTINDEX( pEntity ) ); WRITE_STRING( text ); @@ -660,7 +660,7 @@ void ClientUserInfoChanged( edict_t *pEntity, char *infobuffer ) if( gpGlobals->maxClients > 1 ) { char text[256]; - snprintf( text, 256, "* %s changed name to %s\n", STRING( pEntity->v.netname ), g_engfuncs.pfnInfoKeyValue( infobuffer, "name" ) ); + _snprintf( text, 256, "* %s changed name to %s\n", STRING( pEntity->v.netname ), g_engfuncs.pfnInfoKeyValue( infobuffer, "name" ) ); MESSAGE_BEGIN( MSG_ALL, gmsgSayText, NULL ); WRITE_BYTE( ENTINDEX( pEntity ) ); WRITE_STRING( text );