diff --git a/tools/quake3/common/cmdlib.c b/tools/quake3/common/cmdlib.c index a2045070..7a7c8da2 100644 --- a/tools/quake3/common/cmdlib.c +++ b/tools/quake3/common/cmdlib.c @@ -438,7 +438,7 @@ void SafeRead( FILE *f, void *buffer, int count ){ void SafeWrite( FILE *f, const void *buffer, int count ){ - if ( fwrite( buffer, 1, count, f ) != (size_t)count ) { + if ( buffer != NULL && fwrite( buffer, 1, count, f ) != (size_t)count ) { Error( "File write failure" ); } }