prevent buffer overrun with map name

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2284 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2006-05-18 01:43:22 +00:00
parent c14115d90e
commit 60d22a4d20
1 changed files with 2 additions and 2 deletions

View File

@ -1165,9 +1165,9 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
if (val)
{
if (progstype == PROG_H2)
sprintf(sv.mapname, "%s", T_GetString(val->_float-1));
Q_snprintfz(sv.mapname, sizeof(sv.mapname), "%s", T_GetString(val->_float-1));
else
sprintf(sv.mapname, "%s", PR_GetString(svprogfuncs, val->string));
Q_snprintfz(sv.mapname, sizeof(sv.mapname), "%s", PR_GetString(svprogfuncs, val->string));
}
if (Cvar_Get("sv_readonlyworld", "1", 0, "DP compatability")->value)
ent->readonly = true; //lock it down!