b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batctl: Fix format string for raw tp_meter output
@ 2016-05-20 15:30 Sven Eckelmann
  2016-06-13  4:40 ` Marek Lindner
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Eckelmann @ 2016-05-20 15:30 UTC (permalink / raw)
  To: b.a.t.m.a.n

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(-)

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;
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batctl: Fix format string for raw tp_meter output
  2016-05-20 15:30 [B.A.T.M.A.N.] [PATCH] batctl: Fix format string for raw tp_meter output Sven Eckelmann
@ 2016-06-13  4:40 ` Marek Lindner
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Lindner @ 2016-06-13  4:40 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 417 bytes --]

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

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-13  4:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-20 15:30 [B.A.T.M.A.N.] [PATCH] batctl: Fix format string for raw tp_meter output Sven Eckelmann
2016-06-13  4:40 ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).