mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-23 21:24:27 +00:00
Safe _snprintf usage.
This commit is contained in:
parent
a6db1c3c32
commit
6af5c3f472
@ -182,19 +182,23 @@ int CHudTextMessage::MsgFunc_TextMsg( const char *pszName, int iSize, void *pbuf
|
||||
{
|
||||
case HUD_PRINTCENTER:
|
||||
_snprintf( psz, MSG_BUF_SIZE, szBuf[0], szBuf[1], szBuf[2], szBuf[3], szBuf[4] );
|
||||
psz[MSG_BUF_SIZE - 1] = '\0';
|
||||
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] );
|
||||
psz[MSG_BUF_SIZE - 2] = '\0';
|
||||
ConsolePrint( ConvertCRtoNL( psz ) );
|
||||
break;
|
||||
case HUD_PRINTTALK:
|
||||
_snprintf( psz, MSG_BUF_SIZE, szBuf[0], szBuf[1], szBuf[2], szBuf[3], szBuf[4] );
|
||||
psz[MSG_BUF_SIZE - 1] = '\0';
|
||||
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] );
|
||||
psz[MSG_BUF_SIZE - 1] = '\0';
|
||||
ConsolePrint( ConvertCRtoNL( psz ) );
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user