summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2012-09-04 20:29:18 +0200
committerKozlov Dmitry <xeb@mail.ru>2012-09-05 22:16:03 +0400
commit5f355048894ede9e983c7f02cc5915385620db3f (patch)
tree546bfa35e93ad271078da7fac67e14cc8e798548
parent07ead7eed242981335aadd34aa3d7b3e7da33b81 (diff)
downloadaccel-ppp-5f355048894ede9e983c7f02cc5915385620db3f.tar.gz
accel-ppp-5f355048894ede9e983c7f02cc5915385620db3f.zip
Fix format string errors
Fix several errors and compiler warnings in format string arguments. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
-rw-r--r--accel-pppd/ctrl/l2tp/packet.c2
-rw-r--r--accel-pppd/ctrl/pppoe/cli.c2
-rw-r--r--accel-pppd/ctrl/pppoe/pppoe.c2
-rw-r--r--accel-pppd/ctrl/pptp/pptp.c3
-rw-r--r--accel-pppd/extra/connlimit.c11
-rw-r--r--accel-pppd/ipv6/dhcpv6.c3
-rw-r--r--accel-pppd/ppp/ppp_lcp.c2
-rw-r--r--accel-pppd/radius/serv.c4
8 files changed, 16 insertions, 13 deletions
diff --git a/accel-pppd/ctrl/l2tp/packet.c b/accel-pppd/ctrl/l2tp/packet.c
index 60b9d36c..70d8d5d9 100644
--- a/accel-pppd/ctrl/l2tp/packet.c
+++ b/accel-pppd/ctrl/l2tp/packet.c
@@ -158,7 +158,7 @@ int l2tp_recv(int fd, struct l2tp_packet_t **p, struct in_pktinfo *pkt_info)
if (n < sizeof(*hdr)) {
if (conf_verbose)
- log_warn("l2tp: short packet received (%i/%i)\n", n, sizeof(*hdr));
+ log_warn("l2tp: short packet received (%i/%zu)\n", n, sizeof(*hdr));
goto out_err_hdr;
}
diff --git a/accel-pppd/ctrl/pppoe/cli.c b/accel-pppd/ctrl/pppoe/cli.c
index 847b8547..26846402 100644
--- a/accel-pppd/ctrl/pppoe/cli.c
+++ b/accel-pppd/ctrl/pppoe/cli.c
@@ -120,7 +120,7 @@ static int show_service_name_exec(const char *cmd, char * const *f, int f_cnt, v
if (conf_service_name)
cli_sendv(cli, "%s\r\n", conf_service_name);
else
- cli_sendv(cli, "*\r\n", conf_service_name);
+ cli_sendv(cli, "*\r\n");
return CLI_CMD_OK;
}
diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c
index e620668f..f36a1cc5 100644
--- a/accel-pppd/ctrl/pppoe/pppoe.c
+++ b/accel-pppd/ctrl/pppoe/pppoe.c
@@ -1350,7 +1350,7 @@ static int init_secret(struct pppoe_serv_t *serv)
DES_cblock key;
if (read(urandom_fd, serv->secret, SECRET_LENGTH) < 0) {
- log_emerg("pppoe: failed to read /dev/urandom\n", strerror(errno));
+ log_emerg("pppoe: failed to read /dev/urandom: %s\n", strerror(errno));
return -1;
}
diff --git a/accel-pppd/ctrl/pptp/pptp.c b/accel-pppd/ctrl/pptp/pptp.c
index f2e9d43c..a3476c5e 100644
--- a/accel-pppd/ctrl/pptp/pptp.c
+++ b/accel-pppd/ctrl/pptp/pptp.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
@@ -222,7 +223,7 @@ static int pptp_start_ctrl_conn_rqst(struct pptp_conn_t *conn)
}
if (msg->version != htons(PPTP_VERSION)) {
- log_ppp_warn("PPTP version mismatch: expecting %x, received %s\n", PPTP_VERSION, msg->version);
+ log_ppp_warn("PPTP version mismatch: expecting %x, received %" PRIu32 "\n", PPTP_VERSION, msg->version);
if (send_pptp_start_ctrl_conn_rply(conn, PPTP_CONN_RES_PROTOCOL, 0))
return -1;
return 0;
diff --git a/accel-pppd/extra/connlimit.c b/accel-pppd/extra/connlimit.c
index dcfc2deb..fd7c952b 100644
--- a/accel-pppd/extra/connlimit.c
+++ b/accel-pppd/extra/connlimit.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -38,7 +39,7 @@ int __export connlimit_check(uint64_t key)
clock_gettime(CLOCK_MONOTONIC, &ts);
pthread_mutex_lock(&lock);
- log_debug("connlimit: check entry %llu\n", key);
+ log_debug("connlimit: check entry %" PRIu64 "\n", key);
list_for_each_safe(pos, n, &items) {
it = list_entry(pos, typeof(*it), entry);
@@ -66,7 +67,7 @@ int __export connlimit_check(uint64_t key)
}
if (d > conf_burst_timeout) {
- log_debug("connlimit: remove %llu\n", it->key);
+ log_debug("connlimit: remove %" PRIu64 "\n", it->key);
list_move(&it->entry, &tmp_list);
}
}
@@ -78,7 +79,7 @@ int __export connlimit_check(uint64_t key)
it->ts = ts;
it->key = key;
- log_debug("connlimit: add entry %llu\n", key);
+ log_debug("connlimit: add entry %" PRIu64 "\n", key);
pthread_mutex_lock(&lock);
list_add(&it->entry, &items);
@@ -88,9 +89,9 @@ int __export connlimit_check(uint64_t key)
}
if (r == 0)
- log_debug("connlimit: accept %llu\n", key);
+ log_debug("connlimit: accept %" PRIu64 "\n", key);
else
- log_debug("connlimit: drop %llu\n", key);
+ log_debug("connlimit: drop %" PRIu64 "\n", key);
while (!list_empty(&tmp_list)) {
diff --git a/accel-pppd/ipv6/dhcpv6.c b/accel-pppd/ipv6/dhcpv6.c
index 5ee7d347..c6201c0d 100644
--- a/accel-pppd/ipv6/dhcpv6.c
+++ b/accel-pppd/ipv6/dhcpv6.c
@@ -173,7 +173,8 @@ static void insert_dp_routes(struct ppp_t *ppp, struct dhcpv6_pd *pd)
if (ioctl(sock6_fd, SIOCADDRT, &rt6)) {
err = errno;
inet_ntop(AF_INET6, &p->addr, str1, sizeof(str1));
- log_ppp_error("dhcpv6: route add %s/%i: %s\n", str1, p->prefix_len);
+ log_ppp_error("dhcpv6: route add %s/%i: %s\n",
+ str1, p->prefix_len, strerror(err));
} else if (conf_verbose) {
inet_ntop(AF_INET6, &p->addr, str1, sizeof(str1));
log_ppp_info2("dhcpv6: route add %s/%i\n", str1, p->prefix_len);
diff --git a/accel-pppd/ppp/ppp_lcp.c b/accel-pppd/ppp/ppp_lcp.c
index 9b56ed18..cf0d003c 100644
--- a/accel-pppd/ppp/ppp_lcp.c
+++ b/accel-pppd/ppp/ppp_lcp.c
@@ -859,7 +859,7 @@ static void lcp_recv(struct ppp_handler_t*h)
break;
case PROTOREJ:
if (conf_ppp_verbose)
- log_ppp_info2("recv [LCP ProtoRej id=%x <%04x>]\n", hdr->code, hdr->id, ntohs(*(uint16_t*)(hdr + 1)));
+ log_ppp_info2("recv [LCP ProtoRej id=%x <%04x>]\n", hdr->id, ntohs(*(uint16_t*)(hdr + 1)));
ppp_recv_proto_rej(lcp->ppp, ntohs(*(uint16_t *)(hdr + 1)));
break;
case IDENT:
diff --git a/accel-pppd/radius/serv.c b/accel-pppd/radius/serv.c
index b7ee0bee..5caf9e13 100644
--- a/accel-pppd/radius/serv.c
+++ b/accel-pppd/radius/serv.c
@@ -232,8 +232,8 @@ static void show_stat(struct rad_server_t *s, void *client)
cli_sendv(client, " fail count: %lu\r\n", s->stat_fail_cnt);
}
- cli_sendv(client, " request count: %lu\r\n", s->req_cnt);
- cli_sendv(client, " queue length: %lu\r\n", s->queue_cnt);
+ cli_sendv(client, " request count: %i\r\n", s->req_cnt);
+ cli_sendv(client, " queue length: %i\r\n", s->queue_cnt);
if (s->auth_port) {
cli_sendv(client, " auth sent: %lu\r\n", s->stat_auth_sent);