From a748f01e7347685207a34dc7ef7f4935fabb7e55 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 27 Oct 2014 01:42:28 +0000 Subject: [PATCH] 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 --- util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); } -- 2.30.2