From: divverent Date: Thu, 5 Mar 2015 10:48:32 +0000 (+0000) Subject: Fix a dpsnprintf use. X-Git-Tag: xonotic-v0.8.1~8^2~9 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=47472df4cb31ceae88fd915970d14267331f0735;p=xonotic%2Fdarkplaces.git Fix a dpsnprintf use. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12194 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_screen.c b/cl_screen.c index 66c17e17..5bcce5f3 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -954,7 +954,8 @@ void R_TimeReport(const char *desc) t = (int) ((r_timereport_current - r_timereport_temp) * 1000000.0 + 0.5); length = dpsnprintf(tempbuf, sizeof(tempbuf), "%8i %s", t, desc); - length = min(length, (int)sizeof(tempbuf) - 1); + if (length < 0) + length = (int)sizeof(tempbuf) - 1; if (r_speeds_longestitem < length) r_speeds_longestitem = length; for (;length < r_speeds_longestitem;length++)