table = scols_new_table();
if (!table)
- err(EXIT_FAILURE, _("failed to initialize output table"));
+ err(EXIT_FAILURE, _("failed to allocate output table"));
if (mod->json) {
scols_table_enable_json(table, 1);
scols_table_set_name(table, "cpus");
for (i = 0; i < ncols; i++) {
data = get_cell_header(desc, cols[i], mod, buf, sizeof(buf));
if (!scols_table_new_column(table, data, 0, 0))
- err(EXIT_FAILURE, _("failed to initialize output column"));
+ err(EXIT_FAILURE, _("failed to allocate output column"));
}
for (i = 0; i < desc->ncpuspos; i++) {
line = scols_table_new_line(table, NULL);
if (!line)
- err(EXIT_FAILURE, _("failed to initialize output line"));
+ err(EXIT_FAILURE, _("failed to allocate output line"));
for (c = 0; c < ncols; c++) {
data = get_cell_data(desc, i, cols[c], mod,
if (!data || !*data)
data = "-";
if (scols_line_set_data(line, c, data))
- err_oom();
+ err(EXIT_FAILURE, _("failed to add output data"));
}
}
va_list args;
if (!ln)
- err(EXIT_FAILURE, _("failed to initialize output line"));
+ err(EXIT_FAILURE, _("failed to allocate output line"));
/* description column */
scols_line_set_data(ln, 0, txt);
xvasprintf(&data, fmt, args);
va_end(args);
- if (data)
- scols_line_refer_data(ln, 1, data);
+ if (data && scols_line_refer_data(ln, 1, data))
+ err(EXIT_FAILURE, _("failed to add output data"));
}
#define add_summary_n(tb, txt, num) add_summary_sprint(tb, txt, "%d", num)
tb = scols_new_table();
if (!tb)
- err(EXIT_FAILURE, _("failed to initialize output table"));
+ err(EXIT_FAILURE, _("failed to allocate output table"));
scols_table_enable_noheadings(tb, 1);
if (mod->json) {