Increase QEx strings limit, for mods that use fancy writebyte hacks.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6170 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2022-01-28 10:47:52 +00:00
parent bc2c6efa08
commit 43565e4363

View file

@ -4107,18 +4107,21 @@ static void CLQEX_ParseServerVars(void)
static char *CLQEX_ReadStrings(void) static char *CLQEX_ReadStrings(void)
{ {
unsigned short count = MSG_ReadShort(), a; unsigned short count = MSG_ReadShort(), a;
const char *arg[8]; const char *arg[256];
static char formatted[8192]; static char formatted[8192];
if (count > countof(arg)) char inputs[65536];
Host_EndGame ("CLQEX_ReadStrings: too many strings (%u>%u)", count, (unsigned)countof(arg)); size_t ofs = 0;
for (a = 0; a < count; a++) for (a = 0; a < count && a < countof(arg); )
{ {
char *s = alloca(8192); arg[a++] = MSG_ReadStringBuffer(inputs+ofs, sizeof(inputs)-1);
arg[a] = s; ofs += strlen(inputs+ofs)+1;
MSG_ReadStringBuffer(s, 8192); if (ofs >= sizeof(inputs))
break;
} }
for (; a < count; a++)
MSG_ReadString(); //don't lose space, though we can't buffer it.
TL_Reformat(formatted, sizeof(formatted), count, arg); TL_Reformat(formatted, sizeof(formatted), a, arg);
return formatted; return formatted;
} }