Browse Source

* f2b_logfile_close() : safer version

master
Alex 'AdUser' Z 8 years ago
parent
commit
31b7b9f9f7
  1. 4
      src/logfile.c

4
src/logfile.c

@ -41,8 +41,12 @@ f2b_logfile_open(f2b_logfile_t *file, const char *path) {
void void
f2b_logfile_close(f2b_logfile_t *file) { f2b_logfile_close(f2b_logfile_t *file) {
assert(file != NULL); assert(file != NULL);
if (file->fd)
fclose(file->fd); fclose(file->fd);
file->opened = false; file->opened = false;
file->fd = NULL;
} }
bool bool

Loading…
Cancel
Save