From 776c01e60b49011527991ce790331a00169659fe Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 21 Mar 2007 21:14:06 +0000 Subject: [PATCH] fixed bug #5067 (essentialy a signed/unsigned warning fixed by casting to unsigned). --- CHANGELOG | 4 ++++ src/api/sockets.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index d9757bae..b40c0d0f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -71,6 +71,10 @@ HISTORY ++ Bug fixes: + 2007-03-21 Simon Goldschmidt + * sockets.c: fixed bug #5067 (essentialy a signed/unsigned warning fixed + by casting to unsigned). + 2007-03-21 Frédéric Bernon * api_lib.c, api_msg.c, tcpip.c: integrate sys_mbox_fetch(conn->mbox, NULL) calls from api_lib.c to tcpip.c's tcpip_apimsg(). Now, use a local variable and not a diff --git a/src/api/sockets.c b/src/api/sockets.c index 222eb446..d482c6e6 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -94,7 +94,7 @@ static int err_to_errno_table[] = { (sizeof(err_to_errno_table)/sizeof(err_to_errno_table[0])) #define err_to_errno(err) \ - (-(err) >= 0 && -(err) < ERR_TO_ERRNO_TABLE_SIZE ? \ + ((unsigned)(-(err)) < ERR_TO_ERRNO_TABLE_SIZE ? \ err_to_errno_table[-(err)] : EIO) #ifdef ERRNO