mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-19 05:10:40 +00:00
netif_find: correctly check if atoi means '0' or error
Fixes: 4528215c99
("netif_find: check if atoi means '0' or error")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
parent
2f8886794f
commit
d4b3a006dc
@ -1714,7 +1714,7 @@ netif_find(const char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
num = (u8_t)atoi(&name[2]);
|
num = (u8_t)atoi(&name[2]);
|
||||||
if (!num && (name[2] != 0)) {
|
if (!num && (name[2] != '0')) {
|
||||||
/* this means atoi has failed */
|
/* this means atoi has failed */
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user