From: Ian Jackson Date: Mon, 27 Oct 2014 01:42:28 +0000 (+0000) Subject: Portabiity fix: Build where sizeof is not compatible with int X-Git-Tag: proposed.ipv6-polypath-fixes-2.v1 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=a748f01e7347685207a34dc7ef7f4935fabb7e55;p=secnet.git Portabiity 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)); }