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 committed by Simon Goldschmidt
parent 2f8886794f
commit d4b3a006dc

View File

@ -1714,7 +1714,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;
}