From: havoc Date: Mon, 14 Aug 2006 22:55:34 +0000 (+0000) Subject: patch from div0: clamp "ping" reply valies in 0..9999 to prevent misparsing in case... X-Git-Tag: xonotic-v0.1.0preview~3830 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c8a752c0764c484a3a135b3239c37ed6713286cf;p=xonotic%2Fdarkplaces.git patch from div0: clamp "ping" reply valies in 0..9999 to prevent misparsing in case of uninitialized ping values git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6556 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/host_cmd.c b/host_cmd.c index d3aed458..f3585d60 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -244,7 +244,7 @@ void Host_Ping_f (void) { if (!client->active) continue; - print("%4i %s\n", (int)floor(client->ping*1000+0.5), client->name); + print("%4i %s\n", bound(0, (int)floor(client->ping*1000+0.5), 9999), client->name); } // now call the Pings command also, which will send a report that contains packet loss for the scoreboard (as well as a simpler ping report)