Use an error_exit macro for tools

This commit is contained in:
Rangi
2021-09-02 03:04:40 -04:00
parent 0d1a029e81
commit c8f06f45d5
3 changed files with 10 additions and 16 deletions

View File

@@ -9,8 +9,7 @@ void scan_file(const char *filename, bool strict) {
FILE *f = fopen(filename, "rb");
if (!f) {
if (strict) {
fprintf(stderr, "Could not open file \"%s\": %s\n", filename, strerror(errno));
exit(1);
error_exit("Could not open file \"%s\": %s\n", filename, strerror(errno));
} else {
return;
}