From 409579512c00b615d99e396392c58de267c9a36b Mon Sep 17 00:00:00 2001 From: bol-van Date: Wed, 7 Jan 2026 13:45:53 +0300 Subject: [PATCH] AI inspired fixes --- ip2net/ip2net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ip2net/ip2net.c b/ip2net/ip2net.c index 77d7139d..9badb080 100644 --- a/ip2net/ip2net.c +++ b/ip2net/ip2net.c @@ -49,7 +49,7 @@ static int ucmp(const void * a, const void * b, void *arg) } static uint32_t mask_from_bitcount(uint32_t zct) { - return zct<32 ? ~((1 << zct) - 1) : 0; + return zct<32 ? ~((1u << zct) - 1) : 0; } // make presorted array unique. return number of unique items. // 1,1,2,3,3,0,0,0 (ct=8) => 1,2,3,0 (ct=4) @@ -138,7 +138,7 @@ static void mask_from_bitcount6_make(uint32_t zct, struct in6_addr *a) int32_t n = (127 - zct) >> 3; memset(a->s6_addr,0xFF,n); memset(a->s6_addr+n,0x00,16-n); - a->s6_addr[n] = ~((1 << (zct & 7)) - 1); + a->s6_addr[n] = ~((1u << (zct & 7)) - 1); } } static struct in6_addr ip6_mask[129];