]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkctl: use table_set_empty_string()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 12 May 2021 16:12:58 +0000 (01:12 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 14 May 2021 00:18:29 +0000 (09:18 +0900)
src/network/networkctl.c

index d60b75a04597e6f8f7fd93372dec1d2d78f1f049..86f85263097a2775a202bede20a88ce3bb26a00c 100644 (file)
@@ -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);