diff --git a/util.cpp b/util.cpp index 694f9130450..0ad9532d651 100644 --- a/util.cpp +++ b/util.cpp @@ -165,7 +165,7 @@ inline int OutputDebugStringF(const char* pszFormat, ...) GetDataDir(pszFile); strlcat(pszFile, "/debug.log", sizeof(pszFile)); fileout = fopen(pszFile, "a"); - setbuf(fileout, NULL); // unbuffered + if (fileout) setbuf(fileout, NULL); // unbuffered } if (fileout) {