mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-21 04:19:57 +00:00
engine: client: fix ParseFile calls
This commit is contained in:
parent
cce7c7d782
commit
4ba95277b9
@ -513,19 +513,19 @@ void CL_ReadLineFile_f( void )
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
p1[0] = Q_atof( token );
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
p1[1] = Q_atof( token );
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
p1[2] = Q_atof( token );
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
|
||||
if( token[0] != '-' )
|
||||
@ -534,15 +534,15 @@ void CL_ReadLineFile_f( void )
|
||||
break;
|
||||
}
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
p2[0] = Q_atof( token );
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
p2[1] = Q_atof( token );
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
p2[2] = Q_atof( token );
|
||||
|
||||
@ -2020,15 +2020,15 @@ void CL_ReadPointFile_f( void )
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
org[0] = Q_atof( token );
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
org[1] = Q_atof( token );
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
if( !pfile ) break;
|
||||
org[2] = Q_atof( token );
|
||||
|
||||
|
@ -234,7 +234,7 @@ void CL_InitCDAudio( const char *filename )
|
||||
pfile = (char *)afile;
|
||||
|
||||
// format: trackname\n [num]
|
||||
while(( pfile = COM_ParseFile( pfile, token )) != NULL )
|
||||
while(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) != NULL )
|
||||
{
|
||||
if( !Q_stricmp( token, "blank" )) token[0] = '\0';
|
||||
Q_strncpy( clgame.cdtracks[c], token, sizeof( clgame.cdtracks[0] ));
|
||||
@ -1535,7 +1535,7 @@ static client_sprite_t *pfnSPR_GetList( char *psz, int *piCount )
|
||||
if( !afile ) return NULL;
|
||||
|
||||
pfile = (char *)afile;
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
numSprites = Q_atoi( token );
|
||||
|
||||
Q_strncpy( pEntry->szListName, psz, sizeof( pEntry->szListName ));
|
||||
@ -1545,30 +1545,30 @@ static client_sprite_t *pfnSPR_GetList( char *psz, int *piCount )
|
||||
|
||||
for( index = 0; index < numSprites; index++ )
|
||||
{
|
||||
if(( pfile = COM_ParseFile( pfile, token )) == NULL )
|
||||
if(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) == NULL )
|
||||
break;
|
||||
|
||||
Q_strncpy( pEntry->pList[index].szName, token, sizeof( pEntry->pList[0].szName ));
|
||||
|
||||
// read resolution
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
pEntry->pList[index].iRes = Q_atoi( token );
|
||||
|
||||
// read spritename
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
Q_strncpy( pEntry->pList[index].szSprite, token, sizeof( pEntry->pList[0].szSprite ));
|
||||
|
||||
// parse rectangle
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
pEntry->pList[index].rc.left = Q_atoi( token );
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
pEntry->pList[index].rc.top = Q_atoi( token );
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
pEntry->pList[index].rc.right = pEntry->pList[index].rc.left + Q_atoi( token );
|
||||
|
||||
pfile = COM_ParseFile( pfile, token );
|
||||
pfile = COM_ParseFile( pfile, token, sizeof( token ));
|
||||
pEntry->pList[index].rc.bottom = pEntry->pList[index].rc.top + Q_atoi( token );
|
||||
|
||||
pEntry->count++;
|
||||
@ -3078,7 +3078,7 @@ char *pfnParseFile( char *data, char *token )
|
||||
{
|
||||
char *out;
|
||||
|
||||
out = _COM_ParseFileSafe( data, token, -1, PFILE_HANDLECOLON, NULL );
|
||||
out = _COM_ParseFileSafe( data, token, INT_MAX, PFILE_HANDLECOLON, NULL );
|
||||
|
||||
return out;
|
||||
}
|
||||
|
@ -1115,7 +1115,7 @@ legacy wrapper
|
||||
*/
|
||||
static char *pfnParseFile( char *buf, char *token )
|
||||
{
|
||||
return COM_ParseFile( buf, token );
|
||||
return COM_ParseFile( buf, token, INT_MAX );
|
||||
}
|
||||
|
||||
// engine callbacks
|
||||
|
@ -1743,7 +1743,7 @@ void CL_ParseResLocation( sizebuf_t *msg )
|
||||
return;
|
||||
}
|
||||
|
||||
while( ( data = COM_ParseFile( data, token ) ) )
|
||||
while( ( data = COM_ParseFile( data, token, sizeof( token ) ) ) )
|
||||
{
|
||||
Con_Reportf( "Adding %s as download location\n", token );
|
||||
|
||||
|
@ -104,7 +104,7 @@ void SCR_CheckStartupVids( void )
|
||||
|
||||
pfile = (char *)afile;
|
||||
|
||||
while(( pfile = COM_ParseFile( pfile, token )) != NULL )
|
||||
while(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) != NULL )
|
||||
{
|
||||
Q_strncpy( cls.movies[c], token, sizeof( cls.movies[0] ));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user