forked from osmocom/wireshark
Don't print too many interface names...
svn path=/trunk/; revision=37253
This commit is contained in:
parent
8b01902a02
commit
487f03612f
13
tshark.c
13
tshark.c
|
@ -2055,6 +2055,16 @@ capture(void)
|
||||||
interface_opts.descr = get_interface_descriptive_name(interface_opts.name);
|
interface_opts.descr = get_interface_descriptive_name(interface_opts.name);
|
||||||
global_capture_opts.ifaces = g_array_remove_index(global_capture_opts.ifaces, i);
|
global_capture_opts.ifaces = g_array_remove_index(global_capture_opts.ifaces, i);
|
||||||
g_array_insert_val(global_capture_opts.ifaces, i, interface_opts);
|
g_array_insert_val(global_capture_opts.ifaces, i, interface_opts);
|
||||||
|
}
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (global_capture_opts.ifaces->len < 2) {
|
||||||
|
#else
|
||||||
|
if (global_capture_opts.ifaces->len < 4) {
|
||||||
|
#endif
|
||||||
|
for (i = 0; i < global_capture_opts.ifaces->len; i++) {
|
||||||
|
interface_options interface_opts;
|
||||||
|
|
||||||
|
interface_opts = g_array_index(global_capture_opts.ifaces, interface_options, i);
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
if (global_capture_opts.ifaces->len > 2) {
|
if (global_capture_opts.ifaces->len > 2) {
|
||||||
g_string_append_printf(str, ",");
|
g_string_append_printf(str, ",");
|
||||||
|
@ -2066,6 +2076,9 @@ capture(void)
|
||||||
}
|
}
|
||||||
g_string_append_printf(str, "%s", interface_opts.descr);
|
g_string_append_printf(str, "%s", interface_opts.descr);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
g_string_append_printf(str, "%u interfaces", global_capture_opts.ifaces->len);
|
||||||
|
}
|
||||||
fprintf(stderr, "Capturing on %s\n", str->str);
|
fprintf(stderr, "Capturing on %s\n", str->str);
|
||||||
g_string_free(str, TRUE);
|
g_string_free(str, TRUE);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue