Browse Source

engine: server: fix ParseFile calls

pull/2/head
Alibek Omarov 3 years ago committed by a1batross
parent
commit
a8c877c841
  1. 12
      engine/server/sv_game.c
  2. 2
      engine/server/sv_init.c

12
engine/server/sv_game.c

@ -908,12 +908,12 @@ uint SV_MapIsValid( const char *filename, const char *spawn_entity, const char * @@ -908,12 +908,12 @@ uint SV_MapIsValid( const char *filename, const char *spawn_entity, const char *
pfile = ents;
while(( pfile = COM_ParseFile( pfile, token )) != NULL )
while(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) != NULL )
{
if( !Q_strcmp( token, "classname" ))
{
// check classname for spawn entity
pfile = COM_ParseFile( pfile, check_name );
pfile = COM_ParseFile( pfile, check_name, sizeof( check_name ));
if( !Q_strcmp( spawn_entity, check_name ))
{
SetBits( flags, MAP_HAS_SPAWNPOINT );
@ -926,7 +926,7 @@ uint SV_MapIsValid( const char *filename, const char *spawn_entity, const char * @@ -926,7 +926,7 @@ uint SV_MapIsValid( const char *filename, const char *spawn_entity, const char *
else if( need_landmark && !Q_strcmp( token, "targetname" ))
{
// check targetname for landmark entity
pfile = COM_ParseFile( pfile, check_name );
pfile = COM_ParseFile( pfile, check_name, sizeof( check_name ));
if( !Q_strcmp( landmark_name, check_name ))
{
@ -4747,14 +4747,14 @@ qboolean SV_ParseEdict( char **pfile, edict_t *ent ) @@ -4747,14 +4747,14 @@ qboolean SV_ParseEdict( char **pfile, edict_t *ent )
string keyname;
// parse key
if(( *pfile = COM_ParseFile( *pfile, token )) == NULL )
if(( *pfile = COM_ParseFile( *pfile, token, sizeof( token ))) == NULL )
Host_Error( "ED_ParseEdict: EOF without closing brace\n" );
if( token[0] == '}' ) break; // end of desc
Q_strncpy( keyname, token, sizeof( keyname ));
// parse value
if(( *pfile = COM_ParseFile( *pfile, token )) == NULL )
if(( *pfile = COM_ParseFile( *pfile, token, sizeof( token ))) == NULL )
Host_Error( "ED_ParseEdict: EOF without closing brace\n" );
if( token[0] == '}' )
@ -4916,7 +4916,7 @@ void SV_LoadFromFile( const char *mapname, char *entities ) @@ -4916,7 +4916,7 @@ void SV_LoadFromFile( const char *mapname, char *entities )
inhibited = 0;
// parse ents
while(( entities = COM_ParseFile( entities, token )) != NULL )
while(( entities = COM_ParseFile( entities, token, sizeof( token ))) != NULL )
{
if( token[0] != '{' )
Host_Error( "ED_LoadFromFile: found %s when expecting {\n", token );

2
engine/server/sv_init.c

@ -287,7 +287,7 @@ void SV_ReadResourceList( const char *filename ) @@ -287,7 +287,7 @@ void SV_ReadResourceList( const char *filename )
Con_DPrintf( "Precaching from %s\n", filename );
Con_DPrintf( "----------------------------------\n" );
while(( pfile = COM_ParseFile( pfile, token )) != NULL )
while(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) != NULL )
{
if( !COM_IsSafeFileToDownload( token ))
continue;

Loading…
Cancel
Save