exit(2) on unsupported positional arguments on command line

Change-Id: I4f2d70d0b0f1b7bdb8604c930aba8fbb53d8bd54
This commit is contained in:
Harald Welte 2019-12-03 22:28:19 +01:00
parent ad08d17e07
commit de67c001b7
3 changed files with 15 additions and 0 deletions

View File

@ -196,6 +196,11 @@ static void handle_options(int argc, char **argv)
break;
}
}
if (argc > optind) {
fprintf(stderr, "Unsupported positional arguments on command line\n");
exit(2);
}
}
int gbproxy_vty_is_config_node(struct vty *vty, int node)

View File

@ -322,6 +322,11 @@ static void handle_options(struct cmdline_cfg *ccfg, int argc, char **argv)
break;
}
}
if (argc > optind) {
fprintf(stderr, "Unsupported positional arguments on command line\n");
exit(2);
}
}
int main(int argc, char **argv)

View File

@ -271,6 +271,11 @@ static void handle_options(int argc, char **argv)
break;
}
}
if (argc > optind) {
fprintf(stderr, "Unsupported positional arguments on command line\n");
exit(2);
}
}
/* default categories */