diff --git a/src/test/net_tests.cpp b/src/test/net_tests.cpp index 711b067ad2..a2ff9a1099 100644 --- a/src/test/net_tests.cpp +++ b/src/test/net_tests.cpp @@ -1301,7 +1301,7 @@ public: { // Construct contents consisting of 0x00 + 12-byte message type + payload. std::vector contents(1 + CMessageHeader::MESSAGE_TYPE_SIZE + payload.size()); - std::copy(mtype.begin(), mtype.end(), reinterpret_cast(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);