Close data file in parse_file_with_callback() at the end
This otherwise leads to build problems on macOS because of too many
open files due to leaked file descriptors.
Thank you, zeromake (https://blog.zeromake.com), for reporting this!
Signed-off-by: Laslo Hunhold <dev@frign.de>
diff --git a/gen/util.c b/gen/util.c
index 332be82..6f21906 100644
--- a/gen/util.c
+++ b/gen/util.c
@@ -282,6 +282,14 @@
}
}
+ /* close file */
+ if (fclose(fp)) {
+ fprintf(stderr, "parse_file_with_callback: fclose '%s': %s.\n",
+ fname, strerror(errno));
+ exit(1);
+ }
+
+ /* cleanup */
free(line);
free(field);
}