Fix bus error in DebugPrint if -datadir given non-existent directory.

This commit is contained in:
Gavin Andresen 2011-01-20 14:57:46 -05:00
parent 415535e47b
commit dbe79d3451

View file

@ -165,7 +165,7 @@ inline int OutputDebugStringF(const char* pszFormat, ...)
GetDataDir(pszFile); GetDataDir(pszFile);
strlcat(pszFile, "/debug.log", sizeof(pszFile)); strlcat(pszFile, "/debug.log", sizeof(pszFile));
fileout = fopen(pszFile, "a"); fileout = fopen(pszFile, "a");
setbuf(fileout, NULL); // unbuffered if (fileout) setbuf(fileout, NULL); // unbuffered
} }
if (fileout) if (fileout)
{ {