Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b44f1b1

Browse files
committedNov 8, 2023
Fix comparison operator error
Begin index didn't be selected.
1 parent 52b367a commit b44f1b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎api/IPAddress.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ bool IPAddress::operator==(const uint8_t* addr) const
259259
{
260260
// IPv4 only comparison to byte pointer
261261
// Can't support IPv6 as we know our type, but not the length of the pointer
262-
return _type == IPv4 && std::equal(_address.begin(), _address.end(), addr);
262+
return _type == IPv4 && std::equal(_address.begin() + IPADDRESS_V4_BYTES_INDEX, _address.end(), addr);
263263
}
264264

265265
uint8_t IPAddress::operator[](int index) const {

0 commit comments

Comments
 (0)
Please sign in to comment.