Mercurial > hg > openttd
changeset 14673:d8ea28da0b8e draft
(svn r19252) -Fix [FS#3639]: writing (console) output to a file failed on Windows if the date would not be logged.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Thu, 25 Feb 2010 18:26:55 +0000 |
parents | 9dca588a0cae |
children | 5c970eab8a8e |
files | src/console.cpp |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/console.cpp +++ b/src/console.cpp @@ -50,7 +50,7 @@ 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);