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:
Axel Lin 2019-12-12 09:23:11 +08:00
parent f857260e29
commit 555812dcec

View File

@ -1744,7 +1744,7 @@ netif_find(const char *name)
}
num = (u8_t)atoi(&name[2]);
if (!num && (name[2] != 0)) {
if (!num && (name[2] != '0')) {
/* this means atoi has failed */
return NULL;
}