summaryrefslogtreecommitdiff
path: root/source/ui_multiplayer.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-09-24 16:24:46 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-09-24 16:24:46 +0000
commit3366e11bbdb586679227494f389039e6d58f8e0e (patch)
tree3ea5f70d17bdb3369a3ff3cb0e5a232e09971bbd /source/ui_multiplayer.c
parent1cbac0b239e6cad5c4b7e1d30e1d0f32b0d8062f (diff)
Com_sprintf -> Q_snprintf, Q_strncpyz -> Q_strlcpy, Q_strcat -> Q_strlcat.
Q_vsnprintf, Q_sprintf, Q_concat, Q_strlcpy, Q_strcat all return number of characters to be written into the buffer regardless of overflow. Removed COM_AppendExtension, FS_CopyFile, FS_RemoveFile, FS_CopyFile_f. Made sure Q2PRO can only write files into subdirectories of the game directory with a fixed extension. Moved `play' command implementation into main client code. Added support for `s_ambient' value of 3. Renamed `net_log_active' cvar to `net_log_enable'. Log files are now written into `logs/' subdirectory.
Diffstat (limited to 'source/ui_multiplayer.c')
-rw-r--r--source/ui_multiplayer.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/ui_multiplayer.c b/source/ui_multiplayer.c
index e33d1db..eaaa942 100644
--- a/source/ui_multiplayer.c
+++ b/source/ui_multiplayer.c
@@ -148,7 +148,7 @@ void UI_AddToServerList( const serverStatus_t *status ) {
if( !map[0] ) {
map = "???";
} else {
- Com_sprintf( value, sizeof( value ), "maps/%s.bsp", map );
+ Q_snprintf( value, sizeof( value ), "maps/%s.bsp", map );
if( FS_LoadFile( value, NULL ) == INVALID_LENGTH ) {
Q_concat( value, sizeof( value ), S_COLOR_RED, map, NULL );
map = value;
@@ -157,7 +157,7 @@ void UI_AddToServerList( const serverStatus_t *status ) {
j = atoi( Info_ValueForKey( info, "maxclients" ) );
k = atoi( Info_ValueForKey( info, "needpass" ) );
- Com_sprintf( key, sizeof( key ), "%s%d/%d",
+ Q_snprintf( key, sizeof( key ), "%s%d/%d",
status->numPlayers < j ? k > 0 ? S_COLOR_YELLOW : "" : S_COLOR_RED,
status->numPlayers, j );
@@ -178,8 +178,8 @@ void UI_AddToServerList( const serverStatus_t *status ) {
} while( info && slot->numRules < MAX_STATUS_RULES );
for( i = 0, player = status->players ; i < status->numPlayers; i++, player++ ) {
- Com_sprintf( key, sizeof( key ), "%d", player->score );
- Com_sprintf( value, sizeof( value ), "%d", player->ping );
+ Q_snprintf( key, sizeof( key ), "%d", player->score );
+ Q_snprintf( value, sizeof( value ), "%d", player->ping );
slot->players[i] = UI_FormatColumns( 0,
key, value, player->name, NULL );
}
@@ -245,8 +245,8 @@ static void AddUnlistedServers( void ) {
}
// save original address
- Q_strncpyz( slot->address, var->string, sizeof( slot->address ) );
- Q_strncpyz( slot->realAddress, var->string, sizeof( slot->realAddress ) );
+ Q_strlcpy( slot->address, var->string, sizeof( slot->address ) );
+ Q_strlcpy( slot->realAddress, var->string, sizeof( slot->realAddress ) );
m_join.names[m_join.list.numItems++] = UI_FormatColumns( 0,
slot->address, "???", "?/?", NULL );