mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-26 12:13:47 +00:00
ip4: ip4addr_aton: fix parsing of the octal IP representation
This commit is contained in:
parent
adbc5b5f71
commit
2e175a23cb
@ -173,6 +173,8 @@ ip4addr_aton(const char *cp, ip4_addr_t *addr)
|
|||||||
}
|
}
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (lwip_isdigit(c)) {
|
if (lwip_isdigit(c)) {
|
||||||
|
if((base == 8) && ((u32_t)(c - '0') >= 8))
|
||||||
|
break;
|
||||||
val = (val * base) + (u32_t)(c - '0');
|
val = (val * base) + (u32_t)(c - '0');
|
||||||
c = *++cp;
|
c = *++cp;
|
||||||
} else if (base == 16 && lwip_isxdigit(c)) {
|
} else if (base == 16 && lwip_isxdigit(c)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user