]> git.decadent.org.uk Git - odhcp6c.git/commitdiff
Fix building with clang 3.4
authorSteven Barth <steven@midlink.org>
Tue, 18 Mar 2014 13:39:22 +0000 (14:39 +0100)
committerSteven Barth <steven@midlink.org>
Tue, 18 Mar 2014 13:39:22 +0000 (14:39 +0100)
src/dhcpv6.c
src/script.c

index bf62b29767233e4dd77b828fa345c26796085b74..c87d289e159687b03aa3fc87f1c9b98b3651c06d 100644 (file)
@@ -248,7 +248,7 @@ static void dhcpv6_send(enum dhcpv6_msg type, uint8_t trid[3], uint32_t ecs)
        void *srv_id = odhcp6c_get_state(STATE_SERVER_ID, &srv_id_len);
 
        // Build IA_PDs
-       size_t ia_pd_entries, ia_pd_len = 0;
+       size_t ia_pd_entries = 0, ia_pd_len = 0;
        uint8_t *ia_pd;
 
        if (type == DHCPV6_MSG_SOLICIT) {
index 92bc46481b3bf993992916e32db9bc4785b2aa4c..61bab67528efba3e5b5d096a072ea1e746ce43fc 100644 (file)
@@ -20,6 +20,7 @@
 #include <syslog.h>
 #include <signal.h>
 #include <unistd.h>
+#include <inttypes.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
 
@@ -175,7 +176,7 @@ static void entry_to_env(const char *name, const void *data, size_t len, enum en
                inet_ntop(AF_INET6, &e[i].target, &buf[buf_len], INET6_ADDRSTRLEN);
                buf_len += strlen(&buf[buf_len]);
                if (type != ENTRY_HOST) {
-                       buf_len += snprintf(&buf[buf_len], 6, "/%hhu", e[i].length);
+                       buf_len += snprintf(&buf[buf_len], 6, "/%"PRIu16, e[i].length);
                        if (type == ENTRY_ROUTE) {
                                buf[buf_len++] = ',';
                                if (!IN6_IS_ADDR_UNSPECIFIED(&e[i].router)) {