mirror of
https://github.com/cathugger/mkp224o.git
synced 2025-12-05 21:27:13 -06:00
correctly handle filter file loading error, small tweak
This commit is contained in:
10
main.c
10
main.c
@@ -3,6 +3,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <pthread.h>
|
||||
@@ -256,8 +257,13 @@ int main(int argc,char **argv)
|
||||
exit(0);
|
||||
}
|
||||
else if (*arg == 'f') {
|
||||
if (argc--)
|
||||
loadfilterfile(*argv++);
|
||||
if (argc--) {
|
||||
const char *filename = *argv++;
|
||||
if (!loadfilterfile(filename)) {
|
||||
fprintf(stderr,"failed to load filter file %s\n",filename);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
e_additional();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user