zmemtopo: Fix table view spacing

Left justify partition number and partition name fields on table view
to better accommodate untrimmed and longer partition names.

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Mete Durlu
2026-07-21 10:10:45 +02:00
committed by Steffen Eiden
parent 39eb46763b
commit 29a1ef0023

View File

@@ -540,8 +540,8 @@ static void table_print_row(char **buf, struct partition *cur,
unsigned int i, s_padding;
s_padding = vdata->entry_len >= SUM_PAD ? vdata->entry_len : SUM_PAD;
concat_w_padding(buf, LPAR_NO_LEN, 0, "%2d", cur->part_nr);
concat_w_padding(buf, LPAR_NAME_LEN, 0, "%s", cur->part_name);
concat_w_padding(buf, LPAR_NO_LEN, 1, "%2d", cur->part_nr);
concat_w_padding(buf, LPAR_NAME_LEN, 1, "%s", cur->part_name);
concat_w_padding(buf, s_padding, 0, "%lu", cur->increment_total);
entries = &cur->entries[g.nesting_level - 1];
for (i = 0; i < entries->count; i++) {
@@ -579,8 +579,8 @@ static void table_print_header(char **buf, struct view_data *vdata)
}
util_concatf(buf, "\n");
}
util_concatf(buf, "%*s", LPAR_NO_LEN, "NR");
util_concatf(buf, "%*s", LPAR_NAME_LEN, "LPAR");
util_concatf(buf, "%-*s", LPAR_NO_LEN, "NR");
util_concatf(buf, "%-*s", LPAR_NAME_LEN, "LPAR");
util_concatf(buf, "%*s\n", s_padding, "SUM");
}