mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +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;
|
||||
#endif
|
||||
|
||||
if (osdlog)
|
||||
{
|
||||
Bfclose(osdlog);
|
||||
osdlog = NULL;
|
||||
}
|
||||
MAYBE_FCLOSE_AND_NULL(osdlog);
|
||||
|
||||
if (fn) osdlog = Bfopen(fn,"w");
|
||||
if (!fn)
|
||||
return;
|
||||
|
||||
osdlog = Bfopen(fn, "w");
|
||||
|
||||
if (osdlog)
|
||||
setvbuf(osdlog, (char *)NULL, bufmode, 0);
|
||||
setvbuf(osdlog, (char *)NULL, bufmode, BUFSIZ);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue