From d475673b692e6076f540edf7991a0fea2baa1cce Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 8 Oct 2018 13:33:46 +0200 Subject: [PATCH] osmo_client_send_data: Fix wrong log format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to pcap.h, type bpf_u_int32 can be 32 bits on some systems, so better cast explicitly to size_t to make sure always correct size is used by log function. Fixes warning: osmo-pcap/src/osmo_client_network.c:175:4: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 7 has type ‘bpf_u_int32’ {aka ‘unsigned int’} [-Wformat=] "Capture len too big %zu\n", in_hdr->caplen); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~ Change-Id: I98654da143218d3e57da4e57781252eb3d3f3d5b --- src/osmo_client_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osmo_client_network.c b/src/osmo_client_network.c index ec03b09..3d741a8 100644 --- a/src/osmo_client_network.c +++ b/src/osmo_client_network.c @@ -172,7 +172,7 @@ void osmo_client_send_data(struct osmo_pcap_client_conn *conn, if (in_hdr->caplen > 9000) { LOGP(DCLIENT, LOGL_ERROR, - "Capture len too big %zu\n", in_hdr->caplen); + "Capture len too big %zu\n", (size_t) in_hdr->caplen); rate_ctr_inc(&conn->client->ctrg->ctr[CLIENT_CTR_2BIG]); return; }