summaryrefslogtreecommitdiff
path: root/flowtop.c
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2015-07-26 13:11:55 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2015-07-26 20:33:25 +0200
commit3368297312366e2a51a7f87d2c9e645692408041 (patch)
treeefe2264fc6e953b6570caa0bf788877c05b8f735 /flowtop.c
parentb9db88f68c11bb52f8edadbc3b365a552cd9489b (diff)
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 <vadim4j@gmail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'flowtop.c')
-rw-r--r--flowtop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/flowtop.c b/flowtop.c
index 53b4f97..9b7e0dc 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.);