mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 21:44:38 +08:00
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 <axel.lin@ingics.com>
This commit is contained in:
parent
ad3530ee10
commit
740182de3c
@ -106,7 +106,7 @@ lwip_strerr(err_t err)
|
|||||||
int
|
int
|
||||||
err_to_errno(err_t err)
|
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 EIO;
|
||||||
}
|
}
|
||||||
return err_to_errno_table[-err];
|
return err_to_errno_table[-err];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user