mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 13:34:38 +08:00
netif_find: correctly check if atoi means '0' or error
Fixes: 4528215c99ba ("netif_find: check if atoi means '0' or error") Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
parent
f857260e29
commit
555812dcec
@ -1744,7 +1744,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…
x
Reference in New Issue
Block a user