summaryrefslogtreecommitdiff
path: root/src/cgame/cg_buildable.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgame/cg_buildable.c')
-rw-r--r--src/cgame/cg_buildable.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c
index ae0ed17e..00e2c2c2 100644
--- a/src/cgame/cg_buildable.c
+++ b/src/cgame/cg_buildable.c
@@ -169,12 +169,13 @@ static qboolean CG_ParseBuildableAnimationFile( const char *filename, buildable_
// 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;
}
@@ -259,12 +260,13 @@ static qboolean CG_ParseBuildableSoundFile( const char *filename, buildable_t bu
// 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;
}