diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/util.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -49,5 +49,9 @@ for_each_line_in_file(FILE *f, void (*cb)(const char *line, void *data), void *d memmove(buffer, buffer + ate, (written = written - ate)); } while ((read = fread(buffer + written, 1, allocated - written, f))); + + if (written > 0) + cb(buffer, data); + free(buffer); } |