]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mount-tool: rely on format-table.c's ersatz logic
authorLennart Poettering <lennart@poettering.net>
Mon, 13 Nov 2023 13:39:04 +0000 (14:39 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 13 Nov 2023 15:13:07 +0000 (16:13 +0100)
Let the table logic handle the special casing ov unavailable data,
rather than doing that ourselves.

src/mount/mount-tool.c

index 29bde2ab8e04dfa8c10d68d048ef06d13fb782c3..53c110226734a032e7562f346a2340f8a91db16c 100644 (file)
@@ -1450,6 +1450,7 @@ static int list_devices(void) {
                 return log_error_errno(r, "Failed to set sort index: %m");
 
         table_set_header(table, arg_legend);
+        table_set_ersatz_string(table, TABLE_ERSATZ_DASH);
 
         FOREACH_DEVICE(e, d) {
                 for (unsigned c = 0; c < _COLUMN_MAX; c++) {
@@ -1486,7 +1487,7 @@ static int list_devices(void) {
                                 break;
                         }
 
-                        r = table_add_cell(table, NULL, c == COLUMN_NODE ? TABLE_PATH : TABLE_STRING, strna(x));
+                        r = table_add_cell(table, NULL, c == COLUMN_NODE ? TABLE_PATH : TABLE_STRING, x);
                         if (r < 0)
                                 return table_log_add_error(r);
                 }