Skip to content

Commit

Permalink
Problem: C4267 warnings due to implicit conversion from size_t to int
Browse files Browse the repository at this point in the history
Solution: change variable type to size_t
  • Loading branch information
sigiesec committed Feb 11, 2019
1 parent 0afc163 commit b05b436
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tcp_address.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ static std::string make_address_string (const char *hbuf,
char *pos = buf;
memcpy (pos, ipv6_prefix, sizeof ipv6_prefix - 1);
pos += sizeof ipv6_prefix - 1;
const int hbuf_len = strlen (hbuf);
const size_t hbuf_len = strlen (hbuf);
memcpy (pos, hbuf, hbuf_len);
pos += hbuf_len;
memcpy (pos, ipv6_suffix, sizeof ipv6_suffix - 1);
Expand Down Expand Up @@ -296,7 +296,7 @@ int zmq::tcp_address_mask_t::to_string (std::string &addr_) const
memcpy (pos, ipv6_prefix, sizeof ipv6_prefix - 1);
pos += sizeof ipv6_prefix - 1;
}
const int hbuf_len = strlen (hbuf);
const size_t hbuf_len = strlen (hbuf);
memcpy (pos, hbuf, hbuf_len);
pos += hbuf_len;
if (_network_address.family () == AF_INET6) {
Expand Down

0 comments on commit b05b436

Please sign in to comment.