]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkctl: do not show '(null)' in HW Address entry
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 29 Jun 2019 17:54:35 +0000 (02:54 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 30 Jun 2019 08:46:35 +0000 (10:46 +0200)
This also fixes indentation.

src/network/networkctl.c

index 5d917793954e33d7aaa8c4286d1d93260777ec78..2a748b8599f7d9f5a98c20cb74dc4ae6fe4804d0 100644 (file)
@@ -1034,8 +1034,8 @@ static int link_status_one(
         if (r < 0)
                 return r;
         r = table_add_cell_stringf(table, NULL, "%s%s%s (%s%s%s)",
-                                  on_color_operational, strna(operational_state), off_color_operational,
-                                  on_color_setup, strna(setup_state), off_color_setup);
+                                   on_color_operational, strna(operational_state), off_color_operational,
+                                   on_color_setup, strna(setup_state), off_color_setup);
         if (r < 0)
                 return r;
 
@@ -1097,10 +1097,10 @@ static int link_status_one(
                 if (r < 0)
                         return r;
                 r = table_add_cell_stringf(table, NULL, "%s%s%s%s",
-                                          ether_addr_to_string(&info->mac_address, ea),
-                                          description ? " (" : "",
-                                          description,
-                                          description ? ")" : "");
+                                           ether_addr_to_string(&info->mac_address, ea),
+                                           description ? " (" : "",
+                                           strempty(description),
+                                           description ? ")" : "");
                 if (r < 0)
                         return r;
         }