summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 8dc2fb9..79a7e7e 100644
--- a/src/util.h
+++ b/src/util.h
@@ -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);
}