inet_addr: return INADDR_NONE(-1) when input string is invalid
now: inet_network("300.10.10.10"); return 0 inet_addr("300.10.10.10"); return 0 glibc and muscle both return INADDR_NONE or -1. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
parent
6f8cb7edd3
commit
d59a9ea189
@ -88,7 +88,7 @@ in_addr_t inet_addr(FAR const char *cp)
|
||||
unsigned int b;
|
||||
unsigned int c;
|
||||
unsigned int d;
|
||||
uint32_t result = 0;
|
||||
uint32_t result = INADDR_NONE;
|
||||
|
||||
switch (sscanf(cp, "%u.%u.%u.%u", &a, &b, &c, &d))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user