lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1414999271-18155-1-git-send-email-mail@eworm.de>
Date:	Mon,  3 Nov 2014 08:21:11 +0100
From:	Christian Hesse <mail@...rm.de>
To:	Stephen Hemminger <stephen@...workplumber.org>
Cc:	netdev@...r.kernel.org, Christian Hesse <mail@...rm.de>
Subject: [PATCH 1/1] 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.
---
 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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ