Skip to content

Commit 03870ca

Browse files
committed
Force use of size_t in distance calculation
1 parent 600daff commit 03870ca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

boost/network/uri/uri.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ inline bool operator==(const uri::string_type &lhs, const uri &rhs) {
310310
}
311311

312312
inline bool operator==(const uri &lhs, const uri::value_type *rhs) {
313-
auto rlen = strlen(rhs);
314-
auto llen = std::distance(lhs.begin(), lhs.end());
315-
if (rlen != std::abs(llen)) return false;
313+
auto rlen = std::strlen(rhs);
314+
size_t llen = std::labs(std::distance(lhs.begin(), lhs.end()));
315+
if (rlen != llen) return false;
316316
return boost::equal(lhs, boost::make_iterator_range(rhs, rhs + rlen));
317317
}
318318

0 commit comments

Comments
 (0)