From a4d74c1a9305c1802d0ab2cfde5d140478baa3b4 Mon Sep 17 00:00:00 2001 From: Sander van Dijk Date: Tue, 15 May 2012 14:41:29 +0000 Subject: [PATCH] pr_cmds.c: Make PF_VarString's buffer a bit larger (fixes UQC's menu). git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@670 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/pr_cmds.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Quake/pr_cmds.c b/Quake/pr_cmds.c index 623d6c88..c4230b50 100644 --- a/Quake/pr_cmds.c +++ b/Quake/pr_cmds.c @@ -49,17 +49,21 @@ static char *PR_GetTempString (void) static char *PF_VarString (int first) { int i; - static char out[256]; + static char out[384]; + size_t s; out[0] = 0; + s = 0; for (i = first; i < pr_argc; i++) { - if ( q_strlcat(out, G_STRING((OFS_PARM0+i*3)), sizeof(out)) >= sizeof(out) ) - { - Con_Printf("PF_VarString: overflow (string truncated)\n"); + s = q_strlcat(out, G_STRING((OFS_PARM0+i*3)), sizeof(out)); + if (s >= sizeof(out)) break; - } } + if (s > 255) + Con_Warning("PF_VarString: %i characters exceeds standard limit of 255.\n", s); + if (s >= sizeof(out)) + Con_Printf("PF_VarString: overflow (string truncated)\n"); return out; }