swrap: Fix comparison of different signedness
authorAndreas Schneider <asn@samba.org>
Tue, 13 Nov 2018 13:28:17 +0000 (14:28 +0100)
committerAndreas Schneider <asn@samba.org>
Tue, 13 Nov 2018 13:32:09 +0000 (14:32 +0100)
Found by csbuild.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
src/socket_wrapper.c

index 2b77cebf516ff4663aa48469cb5b83af6faf5f61..ae3b2b0d8047777543769e7ab29f8030980bfefc 100644 (file)
@@ -1539,7 +1539,7 @@ static int find_socket_info_index(int fd)
                return -1;
        }
 
-       if (fd >= socket_fds_max) {
+       if ((size_t)fd >= socket_fds_max) {
                SWRAP_LOG(SWRAP_LOG_ERROR,
                          "The max socket index limit of %zu has been reached, "
                          "trying to add %d",
@@ -1590,7 +1590,7 @@ static int swrap_create_socket(struct socket_info *si, int fd)
 {
        int idx;
 
-       if (fd >= socket_fds_max) {
+       if ((size_t)fd >= socket_fds_max) {
                SWRAP_LOG(SWRAP_LOG_ERROR,
                          "The max socket index limit of %zu has been reached, "
                          "trying to add %d",