Change in osmo-pcap[master]: osmo_client_send_data: Fix wrong log format

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Oct 8 12:41:36 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/11271 )

Change subject: osmo_client_send_data: Fix wrong log format
......................................................................

osmo_client_send_data: Fix wrong log format

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
---
M src/osmo_client_network.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



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 @@
 
 	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;
 	}

-- 
To view, visit https://gerrit.osmocom.org/11271
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I98654da143218d3e57da4e57781252eb3d3f3d5b
Gerrit-Change-Number: 11271
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181008/fc3e0bd4/attachment.htm>


More information about the gerrit-log mailing list