From: Ian Jackson Date: Mon, 27 Oct 2014 01:42:28 +0000 (+0000) Subject: Portability fix: Build where sizeof is not compatible with int X-Git-Tag: v0.4.0_beta2~18 X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/commitdiff_plain/887c6ac76e2435cdbb89f3e0df423fac75ec373c Portability fix: Build where sizeof is not compatible with int 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 --- diff --git a/util.c b/util.c index 59ed427..6742dad 100644 --- 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)); }