batctl: Fix format string for raw tp_meter output

Message ID 1463758208-31645-1-git-send-email-sven@narfation.org (mailing list archive)
State Accepted, archived
Commit 53081cebda475f434b5383a5fc6c24be0ba9577b
Delegated to: Marek Lindner
Headers

Commit Message

Sven Eckelmann May 20, 2016, 3:30 p.m. UTC
  The tp_meter output for raw bytes is not casting the values to float.
It must therefore use PRIu64 to print the results.

Reported-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 tp_meter.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Marek Lindner June 13, 2016, 4:40 a.m. UTC | #1
On Friday, May 20, 2016 17:30:08 Sven Eckelmann wrote:
> The tp_meter output for raw bytes is not casting the values to float.
> It must therefore use PRIu64 to print the results.
> 
> Reported-by: Simon Wunderlich <sw@simonwunderlich.de>
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
>  tp_meter.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied in revision 53081ce.

Thanks,
Marek
  

Patch

diff --git a/tp_meter.c b/tp_meter.c
index d980ebd..43c19da 100644
--- a/tp_meter.c
+++ b/tp_meter.c
@@ -524,8 +524,8 @@  int tp_meter(char *mesh_iface, int argc, char **argv)
 				(float)throughput / (1<<10),
 				(float)throughput * 8 / 1000);
 		else
-			printf("%lu Bytes/s (%lu Bps)\n",
-				throughput, throughput * 8);
+			printf("%" PRIu64 " Bytes/s (%" PRIu64 " Bps)\n",
+			       throughput, throughput * 8);
 
 		ret = 0;
 		break;