summaryrefslogtreecommitdiffstats
path: root/sys-utils/wdctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys-utils/wdctl.c')
-rw-r--r--sys-utils/wdctl.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys-utils/wdctl.c b/sys-utils/wdctl.c
index 441b7abf9..e47fc70e9 100644
--- a/sys-utils/wdctl.c
+++ b/sys-utils/wdctl.c
@@ -212,7 +212,7 @@ static void add_flag_line(struct libscols_table *table, struct wdinfo *wd, const
line = scols_table_new_line(table, NULL);
if (!line) {
- warn(_("failed to initialize output line"));
+ warn(_("failed to allocate output line"));
return;
}
@@ -239,8 +239,10 @@ static void add_flag_line(struct libscols_table *table, struct wdinfo *wd, const
break;
}
- if (str)
- scols_line_set_data(line, i, str);
+ if (str && scols_line_set_data(line, i, str)) {
+ warn(_("failed to add output data"));
+ break;
+ }
}
}
@@ -256,7 +258,7 @@ static int show_flags(struct wdinfo *wd, uint32_t wanted)
/* create output table */
table = scols_new_table();
if (!table) {
- warn(_("failed to initialize output table"));
+ warn(_("failed to allocate output table"));
return -1;
}
scols_table_enable_raw(table, raw);
@@ -267,7 +269,7 @@ static int show_flags(struct wdinfo *wd, uint32_t wanted)
struct colinfo *col = get_column_info(i);
if (!scols_table_new_column(table, col->name, col->whint, col->flags)) {
- warnx(_("failed to initialize output column"));
+ warnx(_("failed to allocate output column"));
goto done;
}
}