chiark / gitweb /
Portabiity fix: Build where sizeof is not compatible with int proposed.ipv6-polypath-fixes-2.v1
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 27 Oct 2014 01:42:28 +0000 (01:42 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 27 Oct 2014 01:42:28 +0000 (01:42 +0000)
On Debian amd64, for example:

 util.c: In function 'iaddr_to_string':
 util.c:575:3: error: field precision specifier '.*' expects argument
 of type 'int', but argument 3 has type 'long unsigned int'

Thanks to Jonathan Amery for the report.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
util.c

diff --git a/util.c b/util.c
index 59ed427ca532956bdae93f31d0e898e4e1afd999..6742dad52de4d000b3b2476040c1dd2cca148aaa 100644 (file)
--- a/util.c
+++ b/util.c
@@ -571,7 +571,7 @@ const char *iaddr_to_string(const union iaddr *ia)
     if (r) {
        const char fmt[]= "scoped IPv6 addr, error: %.*s";
        sprintf(addrbuf, fmt,
-               ADNS_ADDR2TEXT_BUFLEN - sizeof(fmt) /* underestimate */,
+               (int)(ADNS_ADDR2TEXT_BUFLEN - sizeof(fmt)) /* underestimate */,
                strerror(r));
     }