From 2f0b98ef912f4b648f12d523ab1fcde6d85f3ea1 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 25 Feb 2010 18:26:55 +0000 Subject: [PATCH] (svn r19252) -Fix [FS#3639]: writing (console) output to a file failed on Windows if the date would not be logged. --- src/console.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/console.cpp b/src/console.cpp index 67b6ffe47b..d486e780c1 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -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);