From 9e05d40825c4eab85a50ca2ed647acd4dffacbec Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 13 Apr 2021 01:47:10 -0700 Subject: [PATCH] tshark.c, ui/qt/main.cpp: fix indentation to match what it's supposed to be. --- tshark.c | 76 +++++++++++++++++++++++++------------------------- ui/qt/main.cpp | 22 +++++++-------- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/tshark.c b/tshark.c index c14724d0bc..67822e6743 100644 --- a/tshark.c +++ b/tshark.c @@ -2187,48 +2187,48 @@ main(int argc, char *argv[]) /* if requested, list the link layer types and exit */ if (caps_queries) { - guint i; + guint i; - /* Get the list of link-layer types for the capture devices. */ - for (i = 0; i < global_capture_opts.ifaces->len; i++) { - interface_options *interface_opts; - if_capabilities_t *caps; - char *auth_str = NULL; - int if_caps_queries = caps_queries; + /* Get the list of link-layer types for the capture devices. */ + for (i = 0; i < global_capture_opts.ifaces->len; i++) { + interface_options *interface_opts; + if_capabilities_t *caps; + char *auth_str = NULL; + int if_caps_queries = caps_queries; - interface_opts = &g_array_index(global_capture_opts.ifaces, interface_options, i); + interface_opts = &g_array_index(global_capture_opts.ifaces, interface_options, i); #ifdef HAVE_PCAP_REMOTE - if (interface_opts->auth_type == CAPTURE_AUTH_PWD) { - auth_str = g_strdup_printf("%s:%s", interface_opts->auth_username, interface_opts->auth_password); - } -#endif - caps = capture_get_if_capabilities(interface_opts->name, interface_opts->monitor_mode, - auth_str, &err_str, &err_str_secondary, NULL); - g_free(auth_str); - if (caps == NULL) { - cmdarg_err("%s%s%s", err_str, err_str_secondary ? "\n" : "", err_str_secondary ? err_str_secondary : ""); - g_free(err_str); - g_free(err_str_secondary); - exit_status = INVALID_CAPABILITY; - goto clean_exit; - } - if ((if_caps_queries & CAPS_QUERY_LINK_TYPES) && caps->data_link_types == NULL) { - cmdarg_err("The capture device \"%s\" has no data link types.", interface_opts->name); - exit_status = IFACE_HAS_NO_LINK_TYPES; - goto clean_exit; - } - if ((if_caps_queries & CAPS_QUERY_TIMESTAMP_TYPES) && caps->timestamp_types == NULL) { - cmdarg_err("The capture device \"%s\" has no timestamp types.", interface_opts->name); - exit_status = INVALID_TIMESTAMP_TYPE; - goto clean_exit; - } - if (interface_opts->monitor_mode) - if_caps_queries |= CAPS_MONITOR_MODE; - capture_opts_print_if_capabilities(caps, interface_opts->name, if_caps_queries); - free_if_capabilities(caps); + if (interface_opts->auth_type == CAPTURE_AUTH_PWD) { + auth_str = g_strdup_printf("%s:%s", interface_opts->auth_username, interface_opts->auth_password); } - exit_status = EXIT_SUCCESS; - goto clean_exit; +#endif + caps = capture_get_if_capabilities(interface_opts->name, interface_opts->monitor_mode, + auth_str, &err_str, &err_str_secondary, NULL); + g_free(auth_str); + if (caps == NULL) { + cmdarg_err("%s%s%s", err_str, err_str_secondary ? "\n" : "", err_str_secondary ? err_str_secondary : ""); + g_free(err_str); + g_free(err_str_secondary); + exit_status = INVALID_CAPABILITY; + goto clean_exit; + } + if ((if_caps_queries & CAPS_QUERY_LINK_TYPES) && caps->data_link_types == NULL) { + cmdarg_err("The capture device \"%s\" has no data link types.", interface_opts->name); + exit_status = IFACE_HAS_NO_LINK_TYPES; + goto clean_exit; + } + if ((if_caps_queries & CAPS_QUERY_TIMESTAMP_TYPES) && caps->timestamp_types == NULL) { + cmdarg_err("The capture device \"%s\" has no timestamp types.", interface_opts->name); + exit_status = INVALID_TIMESTAMP_TYPE; + goto clean_exit; + } + if (interface_opts->monitor_mode) + if_caps_queries |= CAPS_MONITOR_MODE; + capture_opts_print_if_capabilities(caps, interface_opts->name, if_caps_queries); + free_if_capabilities(caps); + } + exit_status = EXIT_SUCCESS; + goto clean_exit; } /* diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp index 35f483fcb9..470f363103 100644 --- a/ui/qt/main.cpp +++ b/ui/qt/main.cpp @@ -905,23 +905,23 @@ int main(int argc, char *qt_argv[]) ret_val = INVALID_CAPABILITY; goto clean_exit; } - if (caps->data_link_types == NULL) { - cmdarg_err("The capture device \"%s\" has no data link types.", device->name); - ret_val = IFACE_HAS_NO_LINK_TYPES; - goto clean_exit; - } + if (caps->data_link_types == NULL) { + cmdarg_err("The capture device \"%s\" has no data link types.", device->name); + ret_val = IFACE_HAS_NO_LINK_TYPES; + goto clean_exit; + } #ifdef _WIN32 - create_console(); + create_console(); #endif /* _WIN32 */ #if defined(HAVE_PCAP_CREATE) - if (device->monitor_mode_supported) - if_caps_queries |= CAPS_MONITOR_MODE; + if (device->monitor_mode_supported) + if_caps_queries |= CAPS_MONITOR_MODE; #endif - capture_opts_print_if_capabilities(caps, device->name, if_caps_queries); + capture_opts_print_if_capabilities(caps, device->name, if_caps_queries); #ifdef _WIN32 - destroy_console(); + destroy_console(); #endif /* _WIN32 */ - free_if_capabilities(caps); + free_if_capabilities(caps); } } ret_val = EXIT_SUCCESS;