From d4b3a006dc8e8fd66aeed5156e35a55c5634f9dd Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 12 Dec 2019 09:23:11 +0800 Subject: [PATCH] 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 --- src/core/netif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/netif.c b/src/core/netif.c index 595fc58c..42d9718e 100644 --- a/src/core/netif.c +++ b/src/core/netif.c @@ -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; }