diff options
author | Guy Harris <gharris@sonic.net> | 2021-04-14 23:36:07 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2021-04-14 23:36:07 -0700 |
commit | 776957ec8bc9d2b2749c50758d5d10c6aeabd062 (patch) | |
tree | 2abe47ff45387e6340461fc84af219b2862bd496 /tshark.c | |
parent | a9b3dfbbc7e39de5b911006600d269293f3862fb (diff) |
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.
Diffstat (limited to 'tshark.c')
-rw-r--r-- | tshark.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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; } |