aboutsummaryrefslogtreecommitdiff
path: root/util.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2011-01-20 14:57:46 -0500
committerGavin Andresen <gavinandresen@gmail.com>2011-01-20 14:57:46 -0500
commitdbe79d3451647dae6d07644081fde7b42a408335 (patch)
treeb2e0badd5272b2a12890bc21795ec12ec830fb04 /util.cpp
parent415535e47be437cd89d70f31e499d2522e6dbeca (diff)
Fix bus error in DebugPrint if -datadir given non-existent directory.
Diffstat (limited to 'util.cpp')
-rw-r--r--util.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.cpp b/util.cpp
index 694f913045..0ad9532d65 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)
{