Check whether any input files were specified, and print an error for

that - otherwise, you get a "No valid input files" message, which
perhaps doesn't make it clear enough that the problem is that there were
no input files, period.

svn path=/trunk/; revision=12410
This commit is contained in:
Guy Harris 2004-10-27 19:36:22 +00:00
parent b18338c3e6
commit 62988d944a
1 changed files with 4 additions and 0 deletions

View File

@ -178,6 +178,10 @@ main(int argc, char *argv[])
fprintf(stderr, " run with -h for help\n");
exit(1);
}
if (in_file_count < 1) {
fprintf(stderr, "mergecap: No input files were specified\n");
exit(1);
}
/* open the input files */
in_file_count = merge_open_in_files(in_file_count, &argv[optind], &in_files, &err);