Commit 776957ec authored by Guy Harris's avatar Guy Harris
Browse files

Clean up the "print interface link-layer/time stamp types" loop.

Initialize the exit status before the loop, and just break out of the
loop if something fails, so that the code following the loop can destroy
the console in Wireshark on Windows and then go to the clean exit code.
parent a9b3dfbb
Pipeline #286745075 passed with stages
in 64 minutes and 35 seconds
......@@ -2192,6 +2192,7 @@ main(int argc, char *argv[])
guint i;
/* Get the list of link-layer types for the capture devices. */
exit_status = EXIT_SUCCESS;
for (i = 0; i < global_capture_opts.ifaces->len; i++) {
interface_options *interface_opts;
if_capabilities_t *caps;
......@@ -2211,15 +2212,15 @@ main(int argc, char *argv[])
g_free(err_str);
g_free(err_str_secondary);
exit_status = INVALID_CAPABILITY;
goto clean_exit;
break;
}
exit_status = capture_opts_print_if_capabilities(caps, interface_opts,
caps_queries);
free_if_capabilities(caps);
if (exit_status != EXIT_SUCCESS)
goto clean_exit;
if (exit_status != EXIT_SUCCESS) {
break;
}
}
exit_status = EXIT_SUCCESS;
goto clean_exit;
}
......
......@@ -895,6 +895,7 @@ int main(int argc, char *qt_argv[])
create_console();
#endif /* _WIN32 */
/* Get the list of link-layer types for the capture devices. */
ret_val = EXIT_SUCCESS;
for (i = 0; i < global_capture_opts.ifaces->len; i++) {
interface_options *interface_opts;
if_capabilities_t *caps;
......@@ -914,19 +915,15 @@ int main(int argc, char *qt_argv[])
g_free(err_str);
g_free(err_str_secondary);
ret_val = INVALID_CAPABILITY;
goto clean_exit;
break;
}
ret_val = capture_opts_print_if_capabilities(caps, interface_opts,
caps_queries);
free_if_capabilities(caps);
if (ret_val != EXIT_SUCCESS) {
#ifdef _WIN32
destroy_console();
#endif /* _WIN32 */
goto clean_exit;
break;
}
}
ret_val = EXIT_SUCCESS;
#ifdef _WIN32
destroy_console();
#endif /* _WIN32 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment