Commit 73f960e7 authored by Ian Barber's avatar Ian Barber

Merge pull request #395 from hintjens/master

Fixed issue #393 - Android build error
parents 77dd0a6f 9aa8452b
...@@ -371,12 +371,11 @@ zmq::tcp_address_t::tcp_address_t (const sockaddr *sa, socklen_t sa_len) ...@@ -371,12 +371,11 @@ zmq::tcp_address_t::tcp_address_t (const sockaddr *sa, socklen_t sa_len)
zmq_assert(sa && sa_len > 0); zmq_assert(sa && sa_len > 0);
memset (&address, 0, sizeof (address)); memset (&address, 0, sizeof (address));
if (sa->sa_family == AF_INET && sa_len >= (socklen_t) sizeof (address.ipv4)) { if (sa->sa_family == AF_INET && (size_t) sa_len >= (socklen_t) sizeof (address.ipv4))
memcpy(&address.ipv4, sa, sizeof (address.ipv4)); memcpy(&address.ipv4, sa, sizeof (address.ipv4));
} else
else if (sa->sa_family == AF_INET6 && sa_len >= (socklen_t) sizeof (address.ipv6)) { if (sa->sa_family == AF_INET6 && (size_t) sa_len >= (socklen_t) sizeof (address.ipv6))
memcpy(&address.ipv6, sa, sizeof (address.ipv6)); memcpy(&address.ipv6, sa, sizeof (address.ipv6));
}
} }
zmq::tcp_address_t::~tcp_address_t () zmq::tcp_address_t::~tcp_address_t ()
...@@ -577,7 +576,7 @@ int zmq::tcp_address_mask_t::to_string (std::string &addr_) ...@@ -577,7 +576,7 @@ int zmq::tcp_address_mask_t::to_string (std::string &addr_)
const bool zmq::tcp_address_mask_t::match_address (const struct sockaddr *ss, const socklen_t ss_len) const const bool zmq::tcp_address_mask_t::match_address (const struct sockaddr *ss, const socklen_t ss_len) const
{ {
zmq_assert (address_mask != -1 && ss != NULL && ss_len >= (socklen_t) sizeof (struct sockaddr)); zmq_assert (address_mask != -1 && ss != NULL && (socklen_t) ss_len >= (socklen_t) sizeof (struct sockaddr));
if (ss->sa_family != address.generic.sa_family) if (ss->sa_family != address.generic.sa_family)
return false; return false;
......
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