From 01b9b37dd889b5b129718ffa2b8d3ac6a80b15c5 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 9 Jan 2023 10:09:45 +0000 Subject: [PATCH] linux: Fix compile warning using clang --- src/privsep-root.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/privsep-root.c b/src/privsep-root.c index 5fda1626..db445ec4 100644 --- a/src/privsep-root.c +++ b/src/privsep-root.c @@ -1110,17 +1110,17 @@ ps_root_getifaddrs(struct dhcpcd_ctx *ctx, struct ifaddrs **ifahead) len -= ALIGN(sizeof(*ifa)) + ALIGN(IFNAMSIZ) + ALIGN(sizeof(salen) * IFA_NADDRS); -#define COPYOUTSA(addr) \ - do { \ - memcpy(&salen, sap, sizeof(salen)); \ - if (len < salen) \ - goto err; \ - if (salen != 0) { \ - (addr) = (struct sockaddr *)bp; \ - bp += ALIGN(salen); \ - len -= ALIGN(salen); \ - } \ - sap += sizeof(salen); \ +#define COPYOUTSA(addr) \ + do { \ + memcpy(&salen, sap, sizeof(salen)); \ + if (len < salen) \ + goto err; \ + if (salen != 0) { \ + (addr) = (struct sockaddr *)(void *)bp; \ + bp += ALIGN(salen); \ + len -= ALIGN(salen); \ + } \ + sap += sizeof(salen); \ } while (0 /* CONSTCOND */) COPYOUTSA(ifa->ifa_addr);