diff options
author | rubidium <rubidium@openttd.org> | 2010-02-25 18:26:55 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-02-25 18:26:55 +0000 |
commit | 88f9ab5b9c0a5203a1462738f27e5b101e4691b8 (patch) | |
tree | 1cafd0e331e478b1922f56e9a0e882dbd9fc95fa /src | |
parent | 2c1b7410f3e7f2a50ea3bd8defd687b010a9a910 (diff) | |
download | openttd-88f9ab5b9c0a5203a1462738f27e5b101e4691b8.tar.xz |
(svn r19252) -Fix [FS#3639]: writing (console) output to a file failed on Windows if the date would not be logged.
Diffstat (limited to 'src')
-rw-r--r-- | src/console.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/console.cpp b/src/console.cpp index 67b6ffe47..d486e780c 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); |