mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2025-11-01 13:54:12 +00:00
ip-link: fix column alignment
Width is the maximum number of characters used for the value, excluding a field separator. So append a single whitespace.
This commit is contained in:
parent
1e264abc3a
commit
f4fe81d26c
@ -327,7 +327,7 @@ static void print_num(FILE *fp, unsigned width, uint64_t count)
|
||||
char buf[64];
|
||||
|
||||
if (!human_readable || count < base) {
|
||||
fprintf(fp, "%-*"PRIu64, width, count);
|
||||
fprintf(fp, "%-*"PRIu64" ", width, count);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -346,7 +346,7 @@ static void print_num(FILE *fp, unsigned width, uint64_t count)
|
||||
snprintf(buf, sizeof(buf), "%.1f%c%s", (double) count / powi,
|
||||
*prefix, use_iec ? "i" : "");
|
||||
|
||||
fprintf(fp, "%-*s", width, buf);
|
||||
fprintf(fp, "%-*s ", width, buf);
|
||||
}
|
||||
|
||||
static void print_link_stats64(FILE *fp, const struct rtnl_link_stats64 *s,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user