From: Yu Watanabe Date: Sat, 29 Jun 2019 17:54:35 +0000 (+0900) Subject: networkctl: do not show '(null)' in HW Address entry X-Git-Tag: v243-rc1~212 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=64e7ebde8bcb3981781903f18ac17da0852fb653;p=thirdparty%2Fsystemd.git networkctl: do not show '(null)' in HW Address entry This also fixes indentation. --- diff --git a/src/network/networkctl.c b/src/network/networkctl.c index 5d917793954..2a748b8599f 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -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; }