From e405f78b8967531ed422351009c6001f4a255647 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 4 Jan 2016 11:56:39 +0800 Subject: [PATCH] Fix output specifier --- miniupnpd/miniupnpd.c | 10 +++++----- miniupnpd/netfilter/iptpinhole.c | 2 +- miniupnpd/pcplearndscp.c | 2 +- miniupnpd/portinuse.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/miniupnpd/miniupnpd.c b/miniupnpd/miniupnpd.c index 8a84198..28fc67c 100644 --- a/miniupnpd/miniupnpd.c +++ b/miniupnpd/miniupnpd.c @@ -154,7 +154,7 @@ tomato_save(const char *fname) fclose(f); rename(tmp, fname); } - else + else { close(t); } @@ -261,7 +261,7 @@ static void tomato_helper(void) { struct stat st; - + if (stat("/etc/upnp/delete", &st) == 0) { tomato_delete(); @@ -1606,7 +1606,7 @@ init(int argc, char * * argv, struct runtime_vars * v) syslog(LOG_ERR, "MiniUPnPd is already running. EXITING"); return 1; } - + #ifdef TOMATO syslog(LOG_NOTICE, "version " MINIUPNPD_VERSION " started"); #endif /* TOMATO */ @@ -1892,7 +1892,7 @@ main(int argc, char * * argv) shttpl_v4 = OpenAndConfHTTPSocket(&listen_port, 0); if(shttpl_v4 < 0) { - syslog(LOG_ERR, "Failed to open socket for HTTP on port %hu (IPv4). EXITING", v.port); + syslog(LOG_ERR, "Failed to open socket for HTTP on port %d (IPv4). EXITING", v.port); return 1; } } @@ -1916,7 +1916,7 @@ main(int argc, char * * argv) shttpsl_v4 = OpenAndConfHTTPSocket(&listen_port, 0); if(shttpsl_v4 < 0) { - syslog(LOG_ERR, "Failed to open socket for HTTPS on port %hu (IPv4). EXITING", v.https_port); + syslog(LOG_ERR, "Failed to open socket for HTTPS on port %d (IPv4). EXITING", v.https_port); return 1; } #endif /* V6SOCKETS_ARE_V6ONLY */ diff --git a/miniupnpd/netfilter/iptpinhole.c b/miniupnpd/netfilter/iptpinhole.c index 978e4c0..861435e 100644 --- a/miniupnpd/netfilter/iptpinhole.c +++ b/miniupnpd/netfilter/iptpinhole.c @@ -297,7 +297,7 @@ delete_pinhole(unsigned short uid) info = (const struct ip6t_tcp *)&match->data; if((info->spts[0] == p->sport) && (info->dpts[0] == p->dport)) { if(!ip6tc_delete_num_entry(miniupnpd_v6_filter_chain, index, h)) { - syslog(LOG_ERR, "ip6tc_delete_num_entry(%s,%d,...): %s", + syslog(LOG_ERR, "ip6tc_delete_num_entry(%s,%u,...): %s", miniupnpd_v6_filter_chain, index, ip6tc_strerror(errno)); goto error; } diff --git a/miniupnpd/pcplearndscp.c b/miniupnpd/pcplearndscp.c index 4a325f6..55814d3 100644 --- a/miniupnpd/pcplearndscp.c +++ b/miniupnpd/pcplearndscp.c @@ -228,7 +228,7 @@ read_learn_dscp_line(struct dscp_values *dscpvalues, char *p) dscpvalues->dscp_value = 38; break; default: - fprintf(stderr, "Unknown AF value %u \n", af_value); + fprintf(stderr, "Unknown AF value %d \n", af_value); goto exit_err_and_cleanup; } } diff --git a/miniupnpd/portinuse.c b/miniupnpd/portinuse.c index 696a5c4..3c664bd 100644 --- a/miniupnpd/portinuse.c +++ b/miniupnpd/portinuse.c @@ -79,7 +79,7 @@ port_in_use(const char *if_name, ip_addr_str[0] = '\0'; } - syslog(LOG_DEBUG, "Check protocol %s for port %d on ext_if %s %s, %08X", + syslog(LOG_DEBUG, "Check protocol %s for port %u on ext_if %s %s, %08X", (proto==IPPROTO_TCP)?"tcp":"udp", eport, if_name, ip_addr_str, (unsigned)ip_addr.s_addr); @@ -101,7 +101,7 @@ port_in_use(const char *if_name, /* TODO add IPV6 support if enabled * Presently assumes IPV4 */ #ifdef DEBUG - syslog(LOG_DEBUG, "port_in_use check port %d and address %s", tmp_port, eaddr); + syslog(LOG_DEBUG, "port_in_use check port %u and address %s", tmp_port, eaddr); #endif if (tmp_port == eport) { char tmp_addr[4];