From 2bfd2a1d9f963a2dc38785deab3bc4bb68d09de7 Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Fri, 18 May 2018 19:05:51 +0200 Subject: [PATCH] fix compiler warnings --- src/ext-fwd.c | 3 ++- src/upnp.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ext-fwd.c b/src/ext-fwd.c index e94e9db5..c7f1ef17 100644 --- a/src/ext-fwd.c +++ b/src/ext-fwd.c @@ -64,8 +64,9 @@ void fwd_debug(FILE *fp) now = time_now_sec(); counter = 0; cur = g_fwds; + while (cur) { - fprintf(fp, " port: %hu\n", cur->port); + fprintf(fp, " port: %d\n", cur->port); if (cur->refreshed == 0) { fprintf(fp, " refreshed: never\n"); diff --git a/src/upnp.c b/src/upnp.c index 33463d6e..483e95cf 100644 --- a/src/upnp.c +++ b/src/upnp.c @@ -179,7 +179,7 @@ int upnp_handler(struct upnp_handle_t *handle, uint16_t port, time_t lifespan, t // Add port forwarding if (handle->state == UPNP_STATE_ADD_PORTMAPPING) { - if (handle->urls.controlURL && handle->data.first.servicetype) { + if (handle->urls.controlURL && handle->data.first.servicetype[0]) { int rc_tcp = upnpAddPortMapping(handle, "TCP", port); int rc_udp = upnpAddPortMapping(handle, "UDP", port);