editcap: give error when using `-r` and no packets
If the user calls `editcap -r` without specifying ranges of packets to keep, abort with an error message.
This commit is contained in:
parent
49b323219c
commit
8b7e9e4b96
|
@ -1829,6 +1829,12 @@ main(int argc, char *argv[])
|
|||
if (add_selection(argv[i], &max_packet_number) == FALSE)
|
||||
break;
|
||||
|
||||
if (keep_em && max_selected == 0) {
|
||||
fprintf(stderr, "editcap: must specify packets to keep when using -r\n");
|
||||
ret = WS_EXIT_INVALID_OPTION;
|
||||
goto clean_exit;
|
||||
}
|
||||
|
||||
if (!keep_em)
|
||||
max_packet_number = G_MAXUINT;
|
||||
|
||||
|
|
Loading…
Reference in New Issue