diff --git a/engine/client/cl_game.c b/engine/client/cl_game.c index d95b672d..43accb9a 100644 --- a/engine/client/cl_game.c +++ b/engine/client/cl_game.c @@ -590,7 +590,11 @@ static void CL_InitTitles( const char *filename ) // initialize text messages (game_text) for( i = 0; i < MAX_TEXTCHANNELS; i++ ) { - cl_textmessage[i].pName = _copystring( clgame.mempool, va( TEXT_MSGNAME, i ), __FILE__, __LINE__ ); + char name[MAX_VA_STRING]; + + Q_snprintf( name, sizeof( name ), TEXT_MSGNAME, i ); + + cl_textmessage[i].pName = _copystring( clgame.mempool, name, __FILE__, __LINE__ ); cl_textmessage[i].pMessage = cl_textbuffer[i]; } @@ -1852,7 +1856,11 @@ client_textmessage_t *CL_TextMessageGet( const char *pName ) // first check internal messages for( i = 0; i < MAX_TEXTCHANNELS; i++ ) { - if( !Q_strcmp( pName, va( TEXT_MSGNAME, i ))) + char name[MAX_VA_STRING]; + + Q_snprintf( name, sizeof( name ), TEXT_MSGNAME, i ); + + if( !Q_strcmp( pName, name )) return cl_textmessage + i; } diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index 016e8cd6..4c236725 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -2694,10 +2694,15 @@ void CL_LegacyParseResourceList( sizebuf_t *msg ) for( i = 0; i < reslist.rescount; i++ ) { + char soundpath[MAX_VA_STRING]; const char *path; if( reslist.restype[i] == t_sound ) - path = va( DEFAULT_SOUNDPATH "%s", reslist.resnames[i] ); + { + Q_snprintf( soundpath, sizeof( soundpath ), DEFAULT_SOUNDPATH "%s", reslist.resnames[i] ); + + path = soundpath; + } else path = reslist.resnames[i]; if( FS_FileExists( path, false )) diff --git a/engine/client/cl_tent.c b/engine/client/cl_tent.c index e0e10c4c..74b6dbf0 100644 --- a/engine/client/cl_tent.c +++ b/engine/client/cl_tent.c @@ -2929,7 +2929,9 @@ void CL_PlayerDecal( int playernum, int customIndex, int entityIndex, float *pos if( !pCust->nUserData1 ) { int sprayTextureIndex; - const char *decalname = va( "player%dlogo%d", playernum, customIndex ); + char decalname[MAX_VA_STRING]; + + Q_snprintf( decalname, sizeof( decalname ), "player%dlogo%d", playernum, customIndex ); sprayTextureIndex = ref.dllFuncs.GL_FindTexture( decalname ); if( sprayTextureIndex != 0 ) { diff --git a/engine/client/s_main.c b/engine/client/s_main.c index 3ba4ea13..6002ac32 100644 --- a/engine/client/s_main.c +++ b/engine/client/s_main.c @@ -1842,8 +1842,12 @@ void S_Music_f( void ) for( i = 0; i < 2; i++ ) { - const char *intro_path = va( "media/%s.%s", intro, ext[i] ); - const char *main_path = va( "media/%s.%s", main, ext[i] ); + char intro_path[MAX_VA_STRING]; + char main_path[MAX_VA_STRING]; + char track_path[MAX_VA_STRING]; + + Q_snprintf( intro_path, sizeof( intro_path ), "media/%s.%s", intro, ext[i] ); + Q_snprintf( main_path, sizeof( main_path ), "media/%s.%s", main, ext[i] ); if( FS_FileExists( intro_path, false ) && FS_FileExists( main_path, false )) { @@ -1851,7 +1855,10 @@ void S_Music_f( void ) S_StartBackgroundTrack( intro, main, 0, false ); break; } - else if( FS_FileExists( va( "media/%s.%s", track, ext[i] ), false )) + + Q_snprintf( track_path, sizeof( track_path ), "media/%s.%s", track, ext[i] ); + + if( FS_FileExists( track_path, false )) { // single non-looped theme S_StartBackgroundTrack( track, NULL, 0, false );