diff --git a/polymer/eduke32/build/src/osd.c b/polymer/eduke32/build/src/osd.c index 0c9bcba34..4cfe65d1c 100644 --- a/polymer/eduke32/build/src/osd.c +++ b/polymer/eduke32/build/src/osd.c @@ -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); }