mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2024-11-10 07:11:54 +00:00
q3map2: more warnings
imported from netradiant, original commit message: > more warnings
This commit is contained in:
parent
58f0f9e557
commit
39a8ddd6d9
1 changed files with 9 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue