summaryrefslogtreecommitdiff
path: root/src/cgame/cg_trails.c
diff options
context:
space:
mode:
authorM. Kristall <mkpdev@gmail.com>2009-10-03 11:41:43 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:14 +0000
commit74ff891914c7f91b0f6c86a7a075a4fafdaf15e5 (patch)
treef415232f36f56a673d29bd7a06577be14f2e9fc5 /src/cgame/cg_trails.c
parent614a658030e59212335611596adb196b93e5b437 (diff)
* Fix a couple more places where files might not be closed (bug 3554)
* Fix off-by-one errors and some gcc warnings
Diffstat (limited to 'src/cgame/cg_trails.c')
-rw-r--r--src/cgame/cg_trails.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cgame/cg_trails.c b/src/cgame/cg_trails.c
index ca610461..f1fb0f5b 100644
--- a/src/cgame/cg_trails.c
+++ b/src/cgame/cg_trails.c
@@ -1060,9 +1060,11 @@ static qboolean CG_ParseTrailFile( const char *fileName )
if( len <= 0 )
return qfalse;
- if( len >= sizeof( text ) - 1 )
+ if( len == 0 || len >= sizeof( text ) - 1 )
{
- CG_Printf( S_COLOR_RED "ERROR: trail file %s too long\n", fileName );
+ trap_FS_FCloseFile( f );
+ CG_Printf( S_COLOR_RED "ERROR: trail file %s is %s\n", fileName,
+ len == 0 ? "empty" : "too long" );
return qfalse;
}