Skip to content

Commit

Permalink
Use copy_n instead of memcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacquwes committed Sep 27, 2023
1 parent a6ac3d1 commit ec02645
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shared/src/socket_messages/hello_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace pine::socket_messages
if (buffer.size() != get_body_size())
return false;

std::memcpy(std::bit_cast<void*>(&version), std::bit_cast<void*>(buffer.data()), sizeof(version));
std::copy_n(buffer.begin(), sizeof(version), std::bit_cast<uint8_t*>(&version));

return true;
}
Expand Down

0 comments on commit ec02645

Please sign in to comment.