From 8f7d3a414205a1b9b609b00cb786b4d7d3cac14a Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 11 Mar 2006 21:28:21 +0000 Subject: Fix bug with corruption of long player names. Remove tab characters. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 416 --- src/net_gui.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/net_gui.c b/src/net_gui.c index b830279f..2e60b4d0 100644 --- a/src/net_gui.c +++ b/src/net_gui.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: net_gui.c 335 2006-01-23 00:37:14Z fraggle $ +// $Id: net_gui.c 416 2006-03-11 21:28:21Z fraggle $ // // Copyright(C) 2005 Simon Howard // @@ -144,11 +144,13 @@ static void DrawScreen(void) if (i < net_clients_in_game) { - snprintf(buf, 15, "%s", net_player_names[i]); + snprintf(buf, 25, "%s", net_player_names[i]); + buf[25] = '\0'; TXT_GotoXY(WINDOW_X + 5, WINDOW_Y + 4 + i); TXT_Puts(buf); snprintf(buf, 16, "%s", net_player_addresses[i]); + buf[16] = '\0'; TXT_GotoXY(WINDOW_X + 33, WINDOW_Y + 4 + i); TXT_Puts(buf); } @@ -181,12 +183,12 @@ void NET_WaitForStart(void) while (net_waiting_for_start) { - if (I_GetTimeMS() > last_draw_time + 50) - { - ProcessEvents(); + if (I_GetTimeMS() > last_draw_time + 50) + { + ProcessEvents(); DrawScreen(); - last_draw_time = I_GetTimeMS(); - } + last_draw_time = I_GetTimeMS(); + } NET_CL_Run(); NET_SV_Run(); -- cgit v1.2.3