From 24529530f34f743e8d9dc2e294126fd5cdb387a8 Mon Sep 17 00:00:00 2001 From: Adam Olsen Date: Thu, 6 Dec 2001 08:51:17 +0000 Subject: [PATCH] - fix printing of Host_NetError message - fix downloading of files >65535 in size --- qw/source/cl_main.c | 6 ++++-- qw/source/sv_user.c | 4 +--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index 0a99788eb..fd823bf1c 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -1377,6 +1377,7 @@ Host_NetError (const char *message, ...) { va_list argptr; int old = 0; + char buf[1024]; old = net_packetlog->int_val; if (net_packetlog->int_val) @@ -1387,11 +1388,12 @@ Host_NetError (const char *message, ...) Cvar_SetValue (net_packetlog, old); va_start (argptr, message); - Host_EndGame (message, argptr); + vsnprintf (buf, sizeof (buf), message, argptr); + va_end (argptr); + Host_EndGame ("%s", buf); Con_Printf ("%s", "Please report this to " "quake-devel@lists.sourceforge.net, including the " "packet log printed out above\n"); - va_end (argptr); } /* diff --git a/qw/source/sv_user.c b/qw/source/sv_user.c index 88906c57f..790d8604f 100644 --- a/qw/source/sv_user.c +++ b/qw/source/sv_user.c @@ -568,9 +568,7 @@ SV_NextDownload_f (void) if (!host_client->download) return; - block.size = host_client->downloadsize - host_client->downloadcount; - if (block.size > 768) - block.size = 768; + block.size = min (host_client->downloadsize - host_client->downloadcount, 768); block.size = Qread (host_client->download, buffer, block.size); host_client->downloadcount += block.size;