[PATCH 15/28] batctl: tpmeter: fix Gbps output
Sven Eckelmann <[email protected]> Sun, 21 Jun 2026 16:24:05 +0200
| Newsgroups | org.open-mesh.lists.batman |
|---|---|
| Message-ID | <[email protected]> |
The formatter for the Gbps result should print 2 digits after the dot. But
the format specifier was different than in all other branches and didn't
specify the precision after the dot. Instead a minimal number of digits (or
spaces) before the dot was defined.
Fixes: f109b3473f86 ("batctl: introduce throughput meter support")
Signed-off-by: Sven Eckelmann <[email protected]>
---
throughputmeter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/throughputmeter.c b/throughputmeter.c
index d670c51..a45eb08 100644
--- a/throughputmeter.c
+++ b/throughputmeter.c
@@ -431,7 +431,7 @@ static int throughputmeter(struct state *state, int argc, char **argv)
if (throughput == UINT64_MAX)
printf("inf\n");
else if (throughput > (1UL << 30))
- printf("%.2f GB/s (%2.f Gbps)\n",
+ printf("%.2f GB/s (%.2f Gbps)\n",
(float)throughput / (1 << 30),
(float)throughput * 8 / 1000000000);
else if (throughput > (1UL << 20))
--
2.47.3