From 555812dcec38c9a2ef1ef9b31816291549fbf9f8 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 1cc28ce3..34842e22 100644 --- a/src/core/netif.c +++ b/src/core/netif.c @@ -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; }