diff options
author | M. Kristall <mkpdev@gmail.com> | 2009-10-03 11:38:19 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:15:11 +0000 |
commit | 393e5ec89e34f449a28bfd0f31324f10c1a9d0dd (patch) | |
tree | 51dfed927aaa8c6375a4d3c04a5d857dc9b869cf /src/cgame/cg_weapons.c | |
parent | 5f037039de1180b04661f0003473496e84f88b8b (diff) |
* (bug 3554) Make sure opened files get closed properly -- for real this time
* (bug 3446) Allow the last spawn to be deconstructed when cheats are enabled
and g_markDeconstruct is not (Ben Millwood)
* (bug 3560) PTRC can be used while the original client is connected
* remove unused functions from src/game/g_ptr.c
Diffstat (limited to 'src/cgame/cg_weapons.c')
-rw-r--r-- | src/cgame/cg_weapons.c | 12 |
1 files changed, 7 insertions, 5 deletions
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; } |