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>
This commit is contained in:
Guy Harris 2020-05-03 13:56:37 -07:00 committed by Guy Harris
parent bd963200ce
commit c9735a3da9
1 changed files with 5 additions and 2 deletions

View File

@ -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);
}