summaryrefslogtreecommitdiff
path: root/src/coredump
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-09-20 20:38:27 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-09-22 10:16:05 +0200
commitc8b62cf60064b8bcbb95db6e97d1ca3931eba341 (patch)
tree07570e10ebf60a777ea0c33da2f3ccf95b7703c9 /src/coredump
parent5515f2169cb5980996044eabb5f1b35e00fd81eb (diff)
downloadsystemd-c8b62cf60064b8bcbb95db6e97d1ca3931eba341.tar.gz
shared/format-table: use enum instead of Table.empty_string
All users were setting this to some static string (usually "-"), so let's simplify things by not doing strdup, but instead limiting callers to a fixed set of values. In preparation for the next commit, the function is renamed from "empty" to "replacement", because it'll be used for more than empty fields. I didn't do the whole string-table setup, because it's all used internally in one file and this way we can immediately assert if an invalid value is passed in. Some callers were (void)ing the error, others were ignoring it, and others propagating. It's nicer to remove the boilerplate.
Diffstat (limited to 'src/coredump')
-rw-r--r--src/coredump/coredumpctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/coredump/coredumpctl.c b/src/coredump/coredumpctl.c
index 6557e98f0a..da0b591c48 100644
--- a/src/coredump/coredumpctl.c
+++ b/src/coredump/coredumpctl.c
@@ -822,7 +822,7 @@ static int dump_list(int argc, char **argv, void *userdata) {
(void) table_set_align_percent(t, TABLE_HEADER_CELL(3), 100);
(void) table_set_align_percent(t, TABLE_HEADER_CELL(7), 100);
- (void) table_set_empty_string(t, "-");
+ table_set_ersatz_string(t, TABLE_ERSATZ_DASH);
} else
pager_open(arg_pager_flags);