netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] ip-link: fix column alignment
@ 2014-11-03  7:21 Christian Hesse
  0 siblings, 0 replies; only message in thread
From: Christian Hesse @ 2014-11-03  7:21 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, Christian Hesse

Width is the maximum number of characters used for the value, excluding a
field separator. So append a single whitespace.
---
 ip/ipaddress.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index efea88c..e240bb5 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -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,
-- 
2.1.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-11-03  7:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-03  7:21 [PATCH 1/1] ip-link: fix column alignment Christian Hesse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).