From 9369f7a9dfc9beedc3d33841097374960f31b445 Mon Sep 17 00:00:00 2001 From: dmiller Date: Sat, 19 Sep 2026 02:26:42 +0000 Subject: [PATCH] Fix mismatch between switch condition and case size On macOS (and probably other BSDs), the sa_family member is 8 bits, so comparing with 0xffff and other 16-bit values overflows. Cast to a wider type to resolve the issue. --- libdnet-stripped/src/addr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdnet-stripped/src/addr.c b/libdnet-stripped/src/addr.c index 292df9375..9a3487e15 100644 --- a/libdnet-stripped/src/addr.c +++ b/libdnet-stripped/src/addr.c @@ -302,7 +302,7 @@ addr_ston(const struct sockaddr *sa, struct addr *a) memset(a, 0, sizeof(*a)); - switch (sa->sa_family) { + switch ((unsigned int)sa->sa_family) { #ifdef HAVE_NET_IF_DL_H # ifdef AF_LINK case AF_LINK: