diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-09-15 20:45:19 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-09-15 20:45:19 +0000 |
commit | 0d87da9c92afbf3c6a1b7f73f0c48fd65f902bed (patch) | |
tree | f5148d2406334d30ba579b0d693c17df561d7574 | |
parent | 673e47d4a9a1a79170bc93b8df23c6ac328bb531 (diff) | |
download | wireshark-0d87da9c92afbf3c6a1b7f73f0c48fd65f902bed.tar.gz |
Don't allow -k and a capture file to both be specified on the command
line - either we're doing a live capture or we're reading a saved
capture file, we can't do both at the same time.
svn path=/trunk/; revision=8475
-rw-r--r-- | gtk/main.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gtk/main.c b/gtk/main.c index 7838515cb3..1f1430f21f 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1,6 +1,6 @@ /* main.c * - * $Id: main.c,v 1.311 2003/09/12 02:48:22 sahlberg Exp $ + * $Id: main.c,v 1.312 2003/09/15 20:45:19 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -2074,8 +2074,15 @@ main(int argc, char *argv[]) #endif #ifdef HAVE_LIBPCAP if (start_capture) { - /* We're supposed to do a live capture; did the user specify an interface - to use? */ + /* We're supposed to do a live capture; did the user also specify + a capture file to read? */ + if (cf_name) { + /* Yes - that's bogus. */ + fprintf(stderr, "ethereal: both live capture (-k) and capture file specified\n"); + exit(2); + } + + /* No - did the user specify an interface to use? */ if (cfile.iface == NULL) { /* No - is a default specified in the preferences file? */ if (prefs->capture_device != NULL) { |