close filter files, more error handling

This commit is contained in:
cathugger
2020-05-22 22:30:14 +00:00
parent e933a9b806
commit a3e141e79b
2 changed files with 11 additions and 5 deletions

6
main.c
View File

@@ -2,6 +2,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
@@ -258,11 +259,8 @@ int main(int argc,char **argv)
}
else if (*arg == 'f') {
if (argc--) {
const char *filename = *argv++;
if (!loadfilterfile(filename)) {
fprintf(stderr,"failed to load filter file %s\n",filename);
if (!loadfilterfile(*argv++))
exit(1);
}
}
else
e_additional();