From 3368297312366e2a51a7f87d2c9e645692408041 Mon Sep 17 00:00:00 2001 From: Vadim Kochan Date: Sun, 26 Jul 2015 13:11:55 +0300 Subject: [PATCH] flowtop: Fix bytes counter print for gigabyte 'G' should be printed when bytes > 1000000000 but it was printed with 'M' prefix which was caused by missing 'else'. Signed-off-by: Vadim Kochan Signed-off-by: Daniel Borkmann --- flowtop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowtop.c b/flowtop.c index 53b4f97b..9b7e0dcb 100644 --- a/flowtop.c +++ b/flowtop.c @@ -713,7 +713,7 @@ static char *bandw2str(double bytes, char *buf, size_t len) { if (bytes > 1000000000.) snprintf(buf, len, "%.1fG", bytes / 1000000000.); - if (bytes > 1000000.) + else if (bytes > 1000000.) snprintf(buf, len, "%.1fM", bytes / 1000000.); else if (bytes > 1000.) snprintf(buf, len, "%.1fK", bytes / 1000.); -- 2.11.4.GIT