mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-30 08:44:31 +00:00
engine: fix NULL ptr dereference when log file cannot be opened
This commit is contained in:
parent
75e8a51058
commit
61643585e0
@ -113,11 +113,16 @@ void Sys_InitLog( void )
|
|||||||
if( s_ld.log_active )
|
if( s_ld.log_active )
|
||||||
{
|
{
|
||||||
s_ld.logfile = fopen( s_ld.log_path, mode );
|
s_ld.logfile = fopen( s_ld.log_path, mode );
|
||||||
if( !s_ld.logfile ) Con_Reportf( S_ERROR "Sys_InitLog: can't create log file %s\n", s_ld.log_path );
|
if( !s_ld.logfile )
|
||||||
|
{
|
||||||
fprintf( s_ld.logfile, "=================================================================================\n" );
|
Con_Reportf( S_ERROR "Sys_InitLog: can't create log file %s\n", s_ld.log_path );
|
||||||
fprintf( s_ld.logfile, "\t%s (build %i) started at %s\n", s_ld.title, Q_buildnum(), Q_timestamp( TIME_FULL ));
|
}
|
||||||
fprintf( s_ld.logfile, "=================================================================================\n" );
|
else
|
||||||
|
{
|
||||||
|
fprintf( s_ld.logfile, "=================================================================================\n" );
|
||||||
|
fprintf( s_ld.logfile, "\t%s (build %i) started at %s\n", s_ld.title, Q_buildnum(), Q_timestamp( TIME_FULL ));
|
||||||
|
fprintf( s_ld.logfile, "=================================================================================\n" );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user