mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-09 01:01:07 +00:00
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
This commit is contained in:
parent
690bd43d22
commit
a4d74c1a93
1 changed files with 9 additions and 5 deletions
|
@ -49,17 +49,21 @@ static char *PR_GetTempString (void)
|
||||||
static char *PF_VarString (int first)
|
static char *PF_VarString (int first)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
static char out[256];
|
static char out[384];
|
||||||
|
size_t s;
|
||||||
|
|
||||||
out[0] = 0;
|
out[0] = 0;
|
||||||
|
s = 0;
|
||||||
for (i = first; i < pr_argc; i++)
|
for (i = first; i < pr_argc; i++)
|
||||||
{
|
{
|
||||||
if ( q_strlcat(out, G_STRING((OFS_PARM0+i*3)), sizeof(out)) >= sizeof(out) )
|
s = q_strlcat(out, G_STRING((OFS_PARM0+i*3)), sizeof(out));
|
||||||
{
|
if (s >= sizeof(out))
|
||||||
Con_Printf("PF_VarString: overflow (string truncated)\n");
|
|
||||||
break;
|
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;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue