diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-10-08 13:33:46 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-10-08 13:33:50 +0200 |
commit | d475673b692e6076f540edf7991a0fea2baa1cce (patch) | |
tree | 4e06cca24d62a9d9ea324a13e22333639c66b197 | |
parent | dc27ca85aa594fae4eddcae459ac7da68d69f92c (diff) |
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
-rw-r--r-- | src/osmo_client_network.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |