aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2020-05-03 13:56:37 -0700
committerGuy Harris <gharris@sonic.net>2020-05-03 21:22:17 +0000
commitc9735a3da9f6bc715476bfd85941936ffebae414 (patch)
tree5974e75fdca985e650b3ccbf714b8c2ae3d2d911 /ui
parentbd963200cef84df076af8e8b169fc9af0edbd2d8 (diff)
Generate a dummy description if we don't have an interface name.
Just have a display name and description of "(Unknown)" if we have no display name, no description, *and* no interface name. Change-Id: I8403779c17c1e6d96d5ba29941081f560ad5339c Reviewed-on: https://code.wireshark.org/review/37086 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <gharris@sonic.net>
Diffstat (limited to 'ui')
-rw-r--r--ui/capture_ui_utils.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ui/capture_ui_utils.c b/ui/capture_ui_utils.c
index 870b7b81a4..21acf8dfcc 100644
--- a/ui/capture_ui_utils.c
+++ b/ui/capture_ui_utils.c
@@ -550,8 +550,11 @@ get_iface_list_string(capture_options *capture_opts, guint32 style)
/*
* We don't have a display name; generate one.
*/
- if (interface_opts->descr == NULL && interface_opts->name) {
- interface_opts->descr = get_interface_descriptive_name(interface_opts->name);
+ if (interface_opts->descr == NULL) {
+ if (interface_opts->name != NULL)
+ interface_opts->descr = get_interface_descriptive_name(interface_opts->name);
+ else
+ interface_opts->descr = g_strdup("(Unknown)");
}
interface_opts->display_name = g_strdup(interface_opts->descr);
}