Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidn committed Jan 14, 2024
1 parent 4ddeeb6 commit 6e7f818
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/torrent_peer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ namespace libtorrent {
{
if (e1.port() > e2.port())
swap(e1, e2);
std::uint32_t p;
auto ptr = reinterpret_cast<char*>(&p);
std::array<char, 4> buf;
auto ptr = buf.data();
aux::write_uint16(e1.port(), ptr);
aux::write_uint16(e2.port(), ptr);
std::uint32_t p;
std::memcpy(&p, buf.data(), 4);
ret = crc32c_32(p);
}
else if (aux::is_v6(e1))
Expand Down

0 comments on commit 6e7f818

Please sign in to comment.