Die when too many arguments are given to ax25dump

This commit is contained in:
XANTRONIX Development 2020-10-06 10:58:39 -04:00 committed by XANTRONIX Industrial
parent 7fdf3a8416
commit ab3679b788

View file

@ -72,6 +72,10 @@ int main(int argc, char **argv) {
if (ifname) { if (ifname) {
patty_client_setsockopt_if ifreq; patty_client_setsockopt_if ifreq;
if (optind < argc) {
usage(argc, argv, "Too many arguments provided");
}
info.flags = PATTY_KISS_TNC_FD; info.flags = PATTY_KISS_TNC_FD;
if ((client = patty_client_new(sock)) == NULL) { if ((client = patty_client_new(sock)) == NULL) {