networkctl: avoid outputting '(null)' for LLDP ports without description
authorLennart Poettering <lennart@poettering.net>
Thu, 15 Aug 2019 17:28:06 +0000 (19:28 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 15 Aug 2019 22:43:34 +0000 (07:43 +0900)
src/network/networkctl.c

index 654955b..3100a2e 100644 (file)
@@ -893,7 +893,7 @@ static int dump_lldp_neighbors(Table *table, const char *prefix, int ifindex) {
                                            "%s on port %s%s%s%s",
                                            strna(system_name), strna(port_id),
                                            isempty(port_description) ? "" : " (",
-                                           port_description,
+                                           strempty(port_description),
                                            isempty(port_description) ? "" : ")");
                 if (r < 0)
                         return r;