test, refactor: Fix -Warray-bounds warning

This commit is contained in:
Hennadii Stepanov 2025-11-03 21:30:02 +00:00 committed by MarcoFalke
parent faf2759c8c
commit 7a4901c902

View File

@ -1301,7 +1301,7 @@ public:
{
// Construct contents consisting of 0x00 + 12-byte message type + payload.
std::vector<uint8_t> contents(1 + CMessageHeader::MESSAGE_TYPE_SIZE + payload.size());
std::copy(mtype.begin(), mtype.end(), reinterpret_cast<char*>(contents.data() + 1));
std::copy(mtype.begin(), mtype.end(), contents.begin() + 1);
std::copy(payload.begin(), payload.end(), contents.begin() + 1 + CMessageHeader::MESSAGE_TYPE_SIZE);
// Send a packet with that as contents.
SendPacket(contents);