summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_players.c4
-rw-r--r--src/cgame/cg_weapons.c12
2 files changed, 9 insertions, 7 deletions
diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c
index f729164a..9a7be70b 100644
--- a/src/cgame/cg_players.c
+++ b/src/cgame/cg_players.c
@@ -110,9 +110,9 @@ static qboolean CG_ParseAnimationFile( const char *filename, clientInfo_t *ci )
if( len < 0 )
return qfalse;
- if( len >= sizeof( text ) - 1 )
+ if( len == 0 || len >= sizeof( text ) - 1 )
{
- CG_Printf( "File %s too long\n", filename );
+ CG_Printf( "File %s is %s\n", filename, len == 0 ? "empty" : "too long" );
trap_FS_FCloseFile( f );
return qfalse;
}
diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c
index e2f7d363..3f290b5d 100644
--- a/src/cgame/cg_weapons.c
+++ b/src/cgame/cg_weapons.c
@@ -102,12 +102,13 @@ static qboolean CG_ParseWeaponAnimationFile( const char *filename, weaponInfo_t
// load the file
len = trap_FS_FOpenFile( filename, &f, FS_READ );
- if( len <= 0 )
+ if( len < 0 )
return qfalse;
- if( len >= sizeof( text ) - 1 )
+ if( len == 0 || len >= sizeof( text ) - 1 )
{
- CG_Printf( "File %s too long\n", filename );
+ trap_FS_FCloseFile( f );
+ CG_Printf( "File %s is %s\n", filename, len == 0 ? "empty" : "too long" );
return qfalse;
}
@@ -540,9 +541,10 @@ static qboolean CG_ParseWeaponFile( const char *filename, weaponInfo_t *wi )
if( len < 0 )
return qfalse;
- if( len >= sizeof( text ) - 1 )
+ if( len == 0 || len >= sizeof( text ) - 1 )
{
- CG_Printf( "File %s too long\n", filename );
+ trap_FS_FCloseFile( f );
+ CG_Printf( "File %s is %s\n", filename, len == 0 ? "empty" : "too long" );
return qfalse;
}