mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Tidy up previous commit.
This commit is contained in:
11
src/util.c
11
src/util.c
@@ -323,11 +323,12 @@ int netmask_length(struct in_addr mask)
|
||||
{
|
||||
int zero_count = 0;
|
||||
|
||||
while (0x0 == (mask.s_addr & 0x1)) {
|
||||
mask.s_addr >>= 1;
|
||||
++zero_count;
|
||||
}
|
||||
|
||||
while (0x0 == (mask.s_addr & 0x1) && zero_count < 32)
|
||||
{
|
||||
mask.s_addr >>= 1;
|
||||
zero_count++;
|
||||
}
|
||||
|
||||
return 32 - zero_count;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user