(svn r12960) -Codechange: handle return values of (some) file system related functions.
This commit is contained in:
@@ -271,8 +271,12 @@ static void IConsoleWriteToLogFile(const char *string)
|
||||
{
|
||||
if (_iconsole_output_file != NULL) {
|
||||
/* if there is an console output file ... also print it there */
|
||||
fwrite(string, strlen(string), 1, _iconsole_output_file);
|
||||
fwrite("\n", 1, 1, _iconsole_output_file);
|
||||
if (fwrite(string, strlen(string), 1, _iconsole_output_file) != 1 ||
|
||||
fwrite("\n", 1, 1, _iconsole_output_file) != 1) {
|
||||
fclose(_iconsole_output_file);
|
||||
_iconsole_output_file = NULL;
|
||||
IConsolePrintF(_icolour_def, "cannot write to log file");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user