From 29a1ef0023e10085072f9aec8485f1a48ff9d632 Mon Sep 17 00:00:00 2001 From: Mete Durlu Date: Tue, 21 Jul 2026 10:10:45 +0200 Subject: [PATCH] zmemtopo: Fix table view spacing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Left justify partition number and partition name fields on table view to better accommodate untrimmed and longer partition names. Reviewed-by: Jan Höppner Signed-off-by: Mete Durlu Signed-off-by: Steffen Eiden --- zmemtopo/zmemtopo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zmemtopo/zmemtopo.c b/zmemtopo/zmemtopo.c index 8855d15c..1b979563 100644 --- a/zmemtopo/zmemtopo.c +++ b/zmemtopo/zmemtopo.c @@ -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"); }