diff options
author | M. Kristall <mkpdev@gmail.com> | 2013-01-02 21:37:00 -0500 |
---|---|---|
committer | M. Kristall <mkpdev@gmail.com> | 2013-01-02 21:37:00 -0500 |
commit | 2be571bfcb52c35e391b59f8dee7324c004dd1a7 (patch) | |
tree | c365fcc335053b282b3503c198aa861d5aaa4c60 /src/cgame | |
parent | 9fc6466c32b1525d70a0cfc68c8715381a63010e (diff) |
CG_CopyLine was ignoring array length (9a5f541)
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_particles.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cgame/cg_particles.c b/src/cgame/cg_particles.c index c76b7f91..d26002a5 100644 --- a/src/cgame/cg_particles.c +++ b/src/cgame/cg_particles.c @@ -642,11 +642,11 @@ static qboolean CG_ParseColor( byte *c, char **text_p ) /* CG_ParseParticle helpers */ -static void CG_CopyLine( int *i, char *toks, size_t size, char **text_p ) +static void CG_CopyLine( int *i, char *toks, size_t num, size_t size, char **text_p ) { char *token; - while( *i < size ) + while( *i < num ) { token = COM_ParseExt( text_p, qfalse ); if( !*token ) @@ -806,7 +806,8 @@ static qboolean CG_ParseParticle( baseParticle_t *bp, char **text_p ) else bp->framerate = atof_neg( token, qfalse ); - CG_CopyLine( &bp->numFrames, bp->shaderNames[ 0 ], MAX_QPATH, text_p ); + CG_CopyLine( &bp->numFrames, bp->shaderNames[ 0 ], + ARRAY_LEN( bp->shaderNames ), MAX_QPATH, text_p ); } else if( !Q_stricmp( token, "model" ) ) { @@ -817,7 +818,8 @@ static qboolean CG_ParseParticle( baseParticle_t *bp, char **text_p ) break; } - CG_CopyLine( &bp->numModels, bp->modelNames[ 0 ], MAX_QPATH, text_p ); + CG_CopyLine( &bp->numModels, bp->modelNames[ 0 ], + ARRAY_LEN( bp->modelNames ), MAX_QPATH, text_p ); } else if( !Q_stricmp( token, "modelAnimation" ) ) { |