(svn r12960) -Codechange: handle return values of (some) file system related functions.

This commit is contained in:
rubidium
2008-05-05 21:54:05 +00:00
parent 15ebb1a292
commit f2683a6037
4 changed files with 19 additions and 14 deletions

View File

@@ -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");
}
}
}