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);