Skip to content

Commit 8e49e07

Browse files
authored
Update HCISocket.cpp
One std::min should be enough :-) Do not know if compilers are so smart to even drop the second attempt. Just to be on the safe side..
1 parent 55cc55c commit 8e49e07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/bluetooth/HCISocket.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ uint32_t ManagementSocket::UserPINCodeReply(const Address& remote, const Address
12461246
command->addr.bdaddr = *remote.Data();
12471247
command->addr.type = type;
12481248
command->pin_len = std::min(pinCode.length(), sizeof(command->pin_code));
1249-
::memcpy(command->pin_code, pinCode.c_str(), std::min(pinCode.length(), sizeof(command->pin_code)));
1249+
::memcpy(command->pin_code, pinCode.c_str(), command->pin_len);
12501250
result = Exchange(MANAGMENT_TIMEOUT, command, command);
12511251
commandResult = command.Result();
12521252
} else {

0 commit comments

Comments
 (0)