mirror of
https://github.com/FWGS/hlsdk-xash3d
synced 2024-11-22 01:47:45 +01:00
More safe strncat usage.
This commit is contained in:
parent
7cffbef773
commit
cea0903626
@ -134,7 +134,8 @@ int CHudMOTD::MsgFunc_MOTD( const char *pszName, int iSize, void *pbuf )
|
||||
BEGIN_READ( pbuf, iSize );
|
||||
|
||||
int is_finished = READ_BYTE();
|
||||
strncat( m_szMOTD, READ_STRING(), sizeof(m_szMOTD) - 1 );
|
||||
strncat( m_szMOTD, READ_STRING(), sizeof(m_szMOTD) - strlen(m_szMOTD) - 1 );
|
||||
m_szMOTD[sizeof(m_szMOTD) - 1] = '\0';
|
||||
|
||||
if( is_finished )
|
||||
{
|
||||
|
@ -173,6 +173,7 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu
|
||||
char killedwith[32];
|
||||
strcpy( killedwith, "d_" );
|
||||
strncat( killedwith, READ_STRING(), sizeof(killedwith) - strlen(killedwith) - 1 );
|
||||
killedwith[sizeof(killedwith) - 1] = '\0';
|
||||
|
||||
#if USE_VGUI
|
||||
if (gViewPort)
|
||||
|
Loading…
Reference in New Issue
Block a user