q3map2: more warnings

imported from netradiant, original commit message:

> more warnings
This commit is contained in:
Rudolf Polzer 2010-10-05 15:06:52 +02:00 committed by Thomas Debesse
parent 58f0f9e557
commit 39a8ddd6d9
1 changed files with 9 additions and 2 deletions

View File

@ -303,7 +303,10 @@ int vfsLoadFile( const char *filename, void **bufferptr, int index ){
return -1;
}
fread( *bufferptr, 1, len, f );
if ( fread( *bufferptr, 1, len, f ) != (size_t) len ) {
fclose( f );
return -1;
}
fclose( f );
// we need to end the buffer with a 0
@ -337,10 +340,14 @@ int vfsLoadFile( const char *filename, void **bufferptr, int index ){
*bufferptr = safe_malloc( len + 1 );
if ( *bufferptr == NULL ) {
fclose( f );
return -1;
}
fread( *bufferptr, 1, len, f );
if ( fread( *bufferptr, 1, len, f ) != (size_t) len ) {
fclose( f );
return -1;
}
fclose( f );
// we need to end the buffer with a 0