From 792318902fe9695f2b5ceb6b8bd2cab79e1b85a9 Mon Sep 17 00:00:00 2001 From: sezero Date: Tue, 15 May 2012 16:10:13 +0000 Subject: [PATCH] don't print both of the two possible warning messages in PF_VarString() git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@671 af15c1b1-3010-417e-b628-4374ebc0bcbd --- quakespasm/Quake/pr_cmds.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/quakespasm/Quake/pr_cmds.c b/quakespasm/Quake/pr_cmds.c index c4230b50..976857d6 100644 --- a/quakespasm/Quake/pr_cmds.c +++ b/quakespasm/Quake/pr_cmds.c @@ -58,12 +58,13 @@ static char *PF_VarString (int first) { s = q_strlcat(out, G_STRING((OFS_PARM0+i*3)), sizeof(out)); if (s >= sizeof(out)) - break; + { + Con_Printf("PF_VarString: overflow (string truncated)\n"); + return out; + } } 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"); + Con_Warning("PF_VarString: %i characters exceeds standard limit of 255.\n", (int) s); return out; }