diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-04-05 16:42:35 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-04-05 23:43:01 +0000 |
commit | d4bfa9c43b05ccbdef212f55fb56b73a5033e5f6 (patch) | |
tree | 50d7e2029b9a8f002cd2e808bdf695a76a1173db /ui/gtk/main_statusbar.c | |
parent | 24af6eeeea3828bbf4e41ad70377aabc3f26252e (diff) | |
download | wireshark-d4bfa9c43b05ccbdef212f55fb56b73a5033e5f6.tar.gz |
Have a common routine for constructing strings listing interfaces.
We have a bunch of duplicated code to make those lists; make a common
routine for that. (dumpcap currently doesn't use it, as the routine in
question uses a routine in libui, which dumpcap doesn't use. We should
probably fix that.)
Change-Id: I9058bf3320d420b8713e90743618972da1d1c6ed
Reviewed-on: https://code.wireshark.org/review/7934
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/gtk/main_statusbar.c')
-rw-r--r-- | ui/gtk/main_statusbar.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/ui/gtk/main_statusbar.c b/ui/gtk/main_statusbar.c index 1e5cb23d8a..44cd1207bd 100644 --- a/ui/gtk/main_statusbar.c +++ b/ui/gtk/main_statusbar.c @@ -811,25 +811,9 @@ statusbar_capture_prepared_cb(capture_session *cap_session _U_) static GString * statusbar_get_interface_names(capture_options *capture_opts) { - guint i; GString *interface_names; - interface_names = g_string_new(""); - -#ifdef _WIN32 - if (capture_opts->ifaces->len < 2) { -#else - if (capture_opts->ifaces->len < 4) { -#endif - for (i = 0; i < capture_opts->ifaces->len; i++) { - if (i > 0) { - g_string_append_printf(interface_names, ", "); - } - g_string_append_printf(interface_names, "%s", get_iface_description_for_interface(capture_opts, i)); - } - } else { - g_string_append_printf(interface_names, "%u interfaces", capture_opts->ifaces->len); - } + interface_names = get_iface_list_string(capture_opts, 0); if (strlen (interface_names->str) > 0) { g_string_append(interface_names, ":"); } |