Commit 73b2b4f1 authored by Andreas Schneider's avatar Andreas Schneider

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: default avatarAndreas Schneider <asn@samba.org>
Reviewed-by: default avatarRalph Boehme <slow@samba.org>
parent 6c1f0750
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment