From patchwork Fri May 20 15:30:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16260 X-Patchwork-Delegate: mareklindner@neomailbox.ch Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id EBC2380F4C; Fri, 20 May 2016 17:30:14 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=narfation.org Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=narfation.org header.i=@narfation.org header.b=fD8pV4JW; dkim-adsp=fail (unprotected policy); dkim-atps=neutral Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2001:4d88:2000:7::2; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=pass header.from=narfation.org Received: from v3-1039.vlinux.de (narfation.org [IPv6:2001:4d88:2000:7::2]) by open-mesh.org (Postfix) with ESMTPS id 5861180C7B for ; Fri, 20 May 2016 17:30:12 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p579E7469.dip0.t-ipconnect.de [87.158.116.105]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 9B6881C8001; Fri, 20 May 2016 17:30:11 +0200 (CEST) Authentication-Results: v3-1039.vlinux.de; dmarc=none header.from=narfation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1463758211; bh=cpAVxpyte05wazFMY7zIbGLWgm4SJ9lzMM3keApj1mE=; h=From:To:Cc:Subject:Date:From; b=fD8pV4JWJTUuvbWIxWLHBijOdEoTeK5PapFa6pbXAHuMqILCJf2hGEhF28mnl1zgF MwZrRkJivArwtdFalzzL5vHTlgWNJ03UFAjUrl5YK+QdXtg/0R/VbIU3OxreYParEC ZXfxqhpxM9hpGCkh3EtuQBlpb3h+Ac1fwk97LU2M= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Fri, 20 May 2016 17:30:08 +0200 Message-Id: <1463758208-31645-1-git-send-email-sven@narfation.org> X-Mailer: git-send-email 2.8.1 Subject: [B.A.T.M.A.N.] [PATCH] batctl: Fix format string for raw tp_meter output X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "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 Signed-off-by: Sven Eckelmann --- 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;