From 740182de3cbc4298d16db17948ad4197af052c04 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 7 Oct 2016 08:30:44 +0800 Subject: [PATCH] err: Fixup error code range checking in err_to_errno This also fixes build error in non-debug build because err_strerr is guarded by LWIP_DEBUG. Fixes: a1c0a0185bc0 ("bug #48823: posix errors should be removed from arch.h (to new file 'lwip/errno.h'))" Signed-off-by: Axel Lin --- src/api/err.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/err.c b/src/api/err.c index 604278bf..30348a91 100644 --- a/src/api/err.c +++ b/src/api/err.c @@ -106,7 +106,7 @@ lwip_strerr(err_t err) int err_to_errno(err_t err) { - if ((err > 0) || (-err >= (err_t)LWIP_ARRAYSIZE(err_strerr))) { + if ((err > 0) || (-err >= (err_t)LWIP_ARRAYSIZE(err_to_errno_table))) { return EIO; } return err_to_errno_table[-err];