From: Yu Watanabe Date: Wed, 12 May 2021 16:12:58 +0000 (+0900) Subject: networkctl: use table_set_empty_string() X-Git-Tag: v249-rc1~230^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=484f22dd66a1e5187c0d6aac30ba56fd3bd856bb;p=thirdparty%2Fsystemd.git networkctl: use table_set_empty_string() --- diff --git a/src/network/networkctl.c b/src/network/networkctl.c index d60b75a0459..86f85263097 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -692,6 +692,8 @@ static int list_links(int argc, char *argv[], void *userdata) { table_set_width(table, 0); table_set_header(table, arg_legend); + if (table_set_empty_string(table, "n/a") < 0) + return log_oom(); assert_se(cell = table_get_cell(table, 0, 0)); (void) table_set_minimum_width(table, cell, 3); @@ -722,10 +724,10 @@ static int list_links(int argc, char *argv[], void *userdata) { r = table_add_many(table, TABLE_INT, links[i].ifindex, TABLE_STRING, links[i].name, - TABLE_STRING, strna(t), - TABLE_STRING, strna(operational_state), + TABLE_STRING, t, + TABLE_STRING, operational_state, TABLE_SET_COLOR, on_color_operational, - TABLE_STRING, strna(setup_state), + TABLE_STRING, setup_state, TABLE_SET_COLOR, on_color_setup); if (r < 0) return table_log_add_error(r);