Check whether any input files were specified, and print an error for
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 27 Oct 2004 19:36:22 +0000 (19:36 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 27 Oct 2004 19:36:22 +0000 (19:36 +0000)
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.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12410 f5534014-38df-0310-8fa8-9805f1628bb7

mergecap.c

index 07552bc1216d50b8e0085fef2a7b2938a8eb972c..047979b46ba381971b8c8922fd6e5419aa85c8b6 100644 (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);