diff options
author | Alexander Blair <snipa@jagtech.io> | 2020-03-27 12:23:00 -0700 |
---|---|---|
committer | Alexander Blair <snipa@jagtech.io> | 2020-03-27 12:23:00 -0700 |
commit | 7d4a93fab3f4bfbb19e0f1ff1feeeadde649b116 (patch) | |
tree | 447f4bd3ab35b0dc19db9397f5b766a26ef2dbdb /src/net/tor_address.cpp | |
parent | Merge pull request #6284 (diff) | |
parent | net: fix incorrect less operator for top/i2p addresses (diff) | |
download | monero-7d4a93fab3f4bfbb19e0f1ff1feeeadde649b116.tar.xz |
Merge pull request #6285
d0641b42 net: fix incorrect less operator for top/i2p addresses (Aaron Hook)
Diffstat (limited to 'src/net/tor_address.cpp')
-rw-r--r-- | src/net/tor_address.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/net/tor_address.cpp b/src/net/tor_address.cpp index 904a9a0fc..4414861e7 100644 --- a/src/net/tor_address.cpp +++ b/src/net/tor_address.cpp @@ -173,7 +173,8 @@ namespace net bool tor_address::less(const tor_address& rhs) const noexcept { - return std::strcmp(host_str(), rhs.host_str()) < 0 || port() < rhs.port(); + int res = std::strcmp(host_str(), rhs.host_str()); + return res < 0 || (res == 0 && port() < rhs.port()); } bool tor_address::is_same_host(const tor_address& rhs) const noexcept |