From db852a14fe067295fa249ef94a55d2db8e5147d9 Mon Sep 17 00:00:00 2001 From: Alexander Huemer Date: Fri, 6 Nov 2015 20:59:01 +0100 Subject: fix some format specifiers --- gtp/gtp.c | 11 ++++++----- gtp/pdp.c | 7 ++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gtp/gtp.c b/gtp/gtp.c index 4436336..a3772ff 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -47,6 +47,7 @@ #include #include #include +#include #include @@ -2676,7 +2677,7 @@ int gtp_decaps0(struct gsn_t *gsn) return 0; gsn->err_readfrom++; LOGP(DLGTP, LOGL_ERROR, - "recvfrom(fd0=%d, buffer=%lx, len=%d) failed: status = %d error = %s\n", + "recvfrom(fd0=%d, buffer=%lx, len=%zu) failed: status = %d error = %s\n", gsn->fd0, (unsigned long)buffer, sizeof(buffer), status, status ? strerror(errno) : "No error"); return -1; @@ -2821,7 +2822,7 @@ int gtp_decaps1c(struct gsn_t *gsn) return 0; gsn->err_readfrom++; LOGP(DLGTP, LOGL_ERROR, - "recvfrom(fd=%d, buffer=%lx, len=%d) failed: status = %d error = %s\n", + "recvfrom(fd=%d, buffer=%lx, len=%zu) failed: status = %d error = %s\n", fd, (unsigned long)buffer, sizeof(buffer), status, status ? strerror(errno) : "No error"); return -1; @@ -2996,7 +2997,7 @@ int gtp_decaps1u(struct gsn_t *gsn) return 0; gsn->err_readfrom++; LOGP(DLGTP, LOGL_ERROR, - "recvfrom(fd1u=%d, buffer=%lx, len=%d) failed: status = %d error = %s\n", + "recvfrom(fd1u=%d, buffer=%lx, len=%zu) failed: status = %d error = %s\n", gsn->fd1u, (unsigned long)buffer, sizeof(buffer), status, status ? strerror(errno) : "No error"); @@ -3129,7 +3130,7 @@ int gtp_data_req(struct gsn_t *gsn, struct pdp_t *pdp, void *pack, unsigned len) if (len > sizeof(union gtp_packet) - sizeof(struct gtp0_header)) { gsn->err_memcpy++; LOGP(DLGTP, LOGL_ERROR, - "Memcpy failed: %d > %d\n", len, + "Memcpy failed: %u > %zu\n", len, sizeof(union gtp_packet) - sizeof(struct gtp0_header)); return EOF; @@ -3152,7 +3153,7 @@ int gtp_data_req(struct gsn_t *gsn, struct pdp_t *pdp, void *pack, unsigned len) sizeof(struct gtp1_header_long)) { gsn->err_memcpy++; LOGP(DLGTP, LOGL_ERROR, - "Memcpy failed: %d > %d\n", len, + "Memcpy failed: %u > %zu\n", len, sizeof(union gtp_packet) - sizeof(struct gtp0_header)); return EOF; diff --git a/gtp/pdp.c b/gtp/pdp.c index e28ffac..f0d6adf 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "pdp.h" #include "lookupa.h" @@ -211,7 +212,7 @@ int pdp_tidset(struct pdp_t *pdp, uint64_t tid) int hash = pdp_tidhash(tid); struct pdp_t *pdp2; struct pdp_t *pdp_prev = NULL; - DEBUGP(DLGTP, "Begin pdp_tidset tid = %llx\n", tid); + DEBUGP(DLGTP, "Begin pdp_tidset tid = %"PRIx64"\n", tid); pdp->tidnext = NULL; pdp->tid = tid; for (pdp2 = hashtid[hash]; pdp2; pdp2 = pdp2->tidnext) @@ -229,7 +230,7 @@ int pdp_tiddel(struct pdp_t *pdp) int hash = pdp_tidhash(pdp->tid); struct pdp_t *pdp2; struct pdp_t *pdp_prev = NULL; - DEBUGP(DLGTP, "Begin pdp_tiddel tid = %llx\n", pdp->tid); + DEBUGP(DLGTP, "Begin pdp_tiddel tid = %"PRIx64"\n", pdp->tid); for (pdp2 = hashtid[hash]; pdp2; pdp2 = pdp2->tidnext) { if (pdp2 == pdp) { if (!pdp_prev) @@ -249,7 +250,7 @@ int pdp_tidget(struct pdp_t **pdp, uint64_t tid) { int hash = pdp_tidhash(tid); struct pdp_t *pdp2; - DEBUGP(DLGTP, "Begin pdp_tidget tid = %llx\n", tid); + DEBUGP(DLGTP, "Begin pdp_tidget tid = %"PRIx64"\n", tid); for (pdp2 = hashtid[hash]; pdp2; pdp2 = pdp2->tidnext) { if (pdp2->tid == tid) { *pdp = pdp2; -- cgit v1.2.3