(svn r19252) -Fix [FS#3639]: writing (console) output to a file failed on Windows if the date would not be logged.

This commit is contained in:
rubidium 2010-02-25 18:26:55 +00:00
parent 2c1b7410f3
commit 88f9ab5b9c
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ static void IConsoleWriteToLogFile(const char *string)
if (_iconsole_output_file != NULL) {
/* if there is an console output file ... also print it there */
const char *header = GetLogPrefix();
if (fwrite(header, strlen(header), 1, _iconsole_output_file) != 1 ||
if ((strlen(header) != 0 && fwrite(header, strlen(header), 1, _iconsole_output_file) != 1) ||
fwrite(string, strlen(string), 1, _iconsole_output_file) != 1 ||
fwrite("\n", 1, 1, _iconsole_output_file) != 1) {
fclose(_iconsole_output_file);