best way to test for integer in [16;31]
This commit is contained in:
parent
60ed85fe70
commit
f3a567cedf
|
@ -85,8 +85,7 @@ static int is_rfc1918addr(const char * addr)
|
||||||
return 1;
|
return 1;
|
||||||
/* 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) */
|
/* 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) */
|
||||||
if(COMPARE(addr, "172.")) {
|
if(COMPARE(addr, "172.")) {
|
||||||
int i = atoi(addr + 4);
|
if((atoi(addr + 4) | 0x0f) == 0x1f)
|
||||||
if((16 <= i) && (i <= 31))
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue