aboutsummaryrefslogtreecommitdiffstats
path: root/ui/cli/tap-hosts.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-12-29 18:24:56 -0800
committerGuy Harris <guy@alum.mit.edu>2018-12-30 02:58:05 +0000
commitaaf709da67942087470f98f0fc5ba92faf15176a (patch)
tree833aa763abfdec511b866bcc9630839ed2be78e7 /ui/cli/tap-hosts.c
parentb0da9cf6d4f246e5fdf81466adc9532ab09aa8f8 (diff)
Use cmdarg_err() to report errors in CLI taps.
Change-Id: Ic6b35220e394f8c67848ed067e4bbddb980d5bc0 Reviewed-on: https://code.wireshark.org/review/31253 Reviewed-by: Guy Harris <guy@alum.mit.edu> Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot
Diffstat (limited to 'ui/cli/tap-hosts.c')
-rw-r--r--ui/cli/tap-hosts.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/cli/tap-hosts.c b/ui/cli/tap-hosts.c
index 6b30b08bcf..87339c23bf 100644
--- a/ui/cli/tap-hosts.c
+++ b/ui/cli/tap-hosts.c
@@ -21,6 +21,8 @@
#include <epan/stat_tap_ui.h>
#include <epan/addr_resolv.h>
+#include <wsutil/cmdarg_err.h>
+
void register_tap_listener_hosts(void);
static gboolean dump_v4 = FALSE;
@@ -104,7 +106,7 @@ hosts_init(const char *opt_arg, void *userdata _U_)
} else if (strcmp("ipv6", tokens[opt_count]) == 0) {
dump_v6 = TRUE;
} else if (opt_count > 0) {
- fprintf(stderr, "tshark: invalid \"-z " TAP_NAME "[,ipv4|ipv6]\" argument\n");
+ cmdarg_err("invalid \"-z " TAP_NAME "[,ipv4|ipv6]\" argument");
exit(1);
}
opt_count++;
@@ -116,7 +118,7 @@ hosts_init(const char *opt_arg, void *userdata _U_)
NULL, NULL, hosts_draw, NULL);
if (error_string) {
/* error, we failed to attach to the tap. clean up */
- fprintf(stderr, "tshark: Couldn't register " TAP_NAME " tap: %s\n",
+ cmdarg_err("Couldn't register " TAP_NAME " tap: %s",
error_string->str);
g_string_free(error_string, TRUE);
exit(1);