fixed crashes when ini, log, and cache files are read-only

This commit is contained in:
Chris Danford
2003-01-11 19:11:55 +00:00
parent 0a92622aac
commit 88840d9020
3 changed files with 13 additions and 3 deletions
+4 -2
View File
@@ -45,7 +45,8 @@ RageLog::~RageLog()
{
Flush();
FreeConsole();
fclose( m_fileLog );
if( m_fileLog )
fclose( m_fileLog );
}
void RageLog::ShowConsole()
@@ -68,7 +69,8 @@ void RageLog::Trace( const char *fmt, ...)
CString sBuff = vssprintf( fmt, va );
va_end(va);
fprintf( m_fileLog, "%s\n", sBuff.GetString() );
if( m_fileLog )
fprintf( m_fileLog, "%s\n", sBuff.GetString() );
printf( "%s\n", sBuff.GetString() );
CrashLog(sBuff);