mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 19:20:38 +00:00
Fix a crash I caused with MSVC in OSD_SetLogFile(). Apparently, the behavior of setvbuf() when passed a NULL ptr for a buffer is actually left up to the implementation regarding what it does with the size parameter... DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4718 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
fca06dc31c
commit
3c8034609f
1 changed files with 6 additions and 7 deletions
|
@ -812,16 +812,15 @@ void OSD_SetLogFile(const char *fn)
|
||||||
const int bufmode = _IOLBF;
|
const int bufmode = _IOLBF;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (osdlog)
|
MAYBE_FCLOSE_AND_NULL(osdlog);
|
||||||
{
|
|
||||||
Bfclose(osdlog);
|
|
||||||
osdlog = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fn) osdlog = Bfopen(fn,"w");
|
if (!fn)
|
||||||
|
return;
|
||||||
|
|
||||||
|
osdlog = Bfopen(fn, "w");
|
||||||
|
|
||||||
if (osdlog)
|
if (osdlog)
|
||||||
setvbuf(osdlog, (char *)NULL, bufmode, 0);
|
setvbuf(osdlog, (char *)NULL, bufmode, BUFSIZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue