aboutsummaryrefslogtreecommitdiffstats
path: root/src/fnetfilter/main.c
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2018-08-11 23:32:40 +0200
committerLibravatar smitsohu <smitsohu@gmail.com>2018-08-11 23:32:40 +0200
commitf8762bcff754911bc4a2a2c8d998f5ba93f4a384 (patch)
treec40ce67b5b98c93de75f14626ab78228e69e8dda /src/fnetfilter/main.c
parentclear all warnings from cppcheck static code analysis (diff)
downloadfirejail-f8762bcff754911bc4a2a2c8d998f5ba93f4a384.tar.gz
firejail-f8762bcff754911bc4a2a2c8d998f5ba93f4a384.tar.zst
firejail-f8762bcff754911bc4a2a2c8d998f5ba93f4a384.zip
various small improvements, fixes, nitpicks
Diffstat (limited to 'src/fnetfilter/main.c')
-rw-r--r--src/fnetfilter/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/fnetfilter/main.c b/src/fnetfilter/main.c
index d8b950e8f..34ebf5926 100644
--- a/src/fnetfilter/main.c
+++ b/src/fnetfilter/main.c
@@ -79,13 +79,17 @@ static void process_template(char *src, const char *dest) {
79 *arg_start = '\0'; 79 *arg_start = '\0';
80 arg_start++; 80 arg_start++;
81 if (*arg_start == '\0') { 81 if (*arg_start == '\0') {
82 fprintf(stderr, "Error fnetfilter: you need to provide at least on argument\n"); 82 fprintf(stderr, "Error fnetfilter: you need to provide at least one argument\n");
83 exit(1); 83 exit(1);
84 } 84 }
85 85
86 // extract the arguments from command line 86 // extract the arguments from command line
87 char *token = strtok(arg_start, ","); 87 char *token = strtok(arg_start, ",");
88 while (token) { 88 while (token) {
89 if (argcnt == MAXARGS) {
90 fprintf(stderr, "Error fnetfilter: only up to %u arguments are supported\n", (unsigned) MAXARGS);
91 exit(1);
92 }
89 // look for abnormal things 93 // look for abnormal things
90 int len = strlen(token); 94 int len = strlen(token);
91 if (strcspn(token, "\\&!?\"'<>%^(){};,*[]") != (size_t)len) { 95 if (strcspn(token, "\\&!?\"'<>%^(){};,*[]") != (size_t)len) {