Browse Source

* f2b_logfile_getline() : fix

master
Alex 'AdUser' Z 8 years ago
parent
commit
2b27e05028
  1. 6
      src/logfile.c

6
src/logfile.c

@ -71,6 +71,12 @@ f2b_logfile_rotated(const f2b_logfile_t *file) {
bool
f2b_logfile_getline(const f2b_logfile_t *file, char *buf, size_t bufsize) {
assert(file != NULL);
assert(buf != NULL);
if (feof(file->fd))
clearerr(file->fd);
/* fread()+EOF set is implementation defined */
if (fgets(buf, bufsize, file->fd) != NULL)
return true;

Loading…
Cancel
Save