diff options
author | Andreas Schneider <asn@samba.org> | 2015-10-16 16:52:46 +0200 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2015-10-19 10:43:07 +0200 |
commit | 73b2b4f16b4b5f51d4e13fba7444844e13a9f7cc (patch) | |
tree | 2692df438a577ebde502acbb7ead5d6574758200 | |
parent | 6c1f0750b122bacbf6bca126ce0e13ccd1e31fe3 (diff) | |
download | socket_wrapper-73b2b4f16b4b5f51d4e13fba7444844e13a9f7cc.tar.gz socket_wrapper-73b2b4f16b4b5f51d4e13fba7444844e13a9f7cc.tar.xz socket_wrapper-73b2b4f16b4b5f51d4e13fba7444844e13a9f7cc.zip |
swrap: Fix compare of signed and unsigned integer expressions
Make sure the values are compared as the same type. iov_len is size_t on
Linux and int on Solaris.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
-rw-r--r-- | src/socket_wrapper.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index 353ad1d..6691738 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -3850,7 +3850,8 @@ static ssize_t swrap_sendmsg_before(int fd, msg->msg_iovlen = i; if (msg->msg_iovlen == 0) { *tmp_iov = msg->msg_iov[0]; - tmp_iov->iov_len = MIN(tmp_iov->iov_len, (size_t)mtu); + tmp_iov->iov_len = MIN((size_t)tmp_iov->iov_len, + (size_t)mtu); msg->msg_iov = tmp_iov; msg->msg_iovlen = 1; } @@ -4067,7 +4068,8 @@ static int swrap_recvmsg_before(int fd, msg->msg_iovlen = i; if (msg->msg_iovlen == 0) { *tmp_iov = msg->msg_iov[0]; - tmp_iov->iov_len = MIN(tmp_iov->iov_len, (size_t)mtu); + tmp_iov->iov_len = MIN((size_t)tmp_iov->iov_len, + (size_t)mtu); msg->msg_iov = tmp_iov; msg->msg_iovlen = 1; } |