From 92f49886cc98c805b94e80b49af0687edb42d037 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 26 Jul 2021 01:32:23 -0700 Subject: [PATCH] dumpcap: clean up capture device open errors. 1) Consistently say "capture device"; not all capture devices are "interfaces" in the sense of "network interfaces' ("any" means "all network interfaces", and capturing may be supported on a USB bus or on D-Bus or....) 2) Use double quotes to quote the device specifier (it probably won't have spaces in its name, but...). 3) Make sure that there's a space between "capture device" and the quoted device name. --- dumpcap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dumpcap.c b/dumpcap.c index e8e8323429..e9c8cd2f57 100644 --- a/dumpcap.c +++ b/dumpcap.c @@ -653,7 +653,7 @@ get_capture_device_open_failure_messages(cap_device_open_status open_status, size_t secondary_errmsg_len) { g_snprintf(errmsg, (gulong) errmsg_len, - "The capture session could not be initiated on interface '%s' (%s).", + "The capture session could not be initiated on capture device \"%s\" (%s).", iface, open_status_str); g_snprintf(secondary_errmsg, (gulong) secondary_errmsg_len, "%s", get_pcap_failure_secondary_error_message(open_status, open_status_str)); @@ -5447,15 +5447,15 @@ main(int argc, char *argv[]) caps = get_if_capabilities(interface_opts, &open_status, &open_status_str); if (caps == NULL) { if (capture_child) { - char *error_msg = g_strdup_printf("The capabilities of the capture device" - " \"%s\" could not be obtained (%s)", + char *error_msg = g_strdup_printf("The capabilities of the capture device " + "\"%s\" could not be obtained (%s)", interface_opts->name, open_status_str); sync_pipe_errmsg_to_parent(2, error_msg, get_pcap_failure_secondary_error_message(open_status, open_status_str)); g_free(error_msg); } else { - cmdarg_err("The capabilities of the capture device" + cmdarg_err("The capabilities of the capture device " "\"%s\" could not be obtained (%s).\n%s", interface_opts->name, open_status_str, get_pcap_failure_secondary_error_message(open_status, open_status_str));