From 245bfed0012869f169a03e56184c780d80cb315a Mon Sep 17 00:00:00 2001 From: Jaskowicz1 Date: Tue, 9 Jan 2024 20:50:06 +0000 Subject: [PATCH] fix: changed utilities back to how it was before --- include/rconpp/rcon.h | 2 +- src/rconpp/utilities.cpp | 2 +- unittest/test.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/rconpp/rcon.h b/include/rconpp/rcon.h index aff9138..b6e12d6 100644 --- a/include/rconpp/rcon.h +++ b/include/rconpp/rcon.h @@ -1,7 +1,7 @@ #pragma once #ifdef _WIN32 -#pragma warning( disable : 4251 ); // 4251 warns when we export classes or structures with stl member variables +#pragma warning( disable : 4251 ) // 4251 warns when we export classes or structures with stl member variables #endif #include "export.h" diff --git a/src/rconpp/utilities.cpp b/src/rconpp/utilities.cpp index 564a81d..38801b8 100644 --- a/src/rconpp/utilities.cpp +++ b/src/rconpp/utilities.cpp @@ -15,7 +15,7 @@ rconpp::packet rconpp::form_packet(const std::string_view data, int32_t id, int3 std::vector temp_data(data_size + 4); /* Create a vector that exactly the size of the packet length. */ - std::memcpy(temp_data.data(), &data_size, sizeof(data_size)); /* Copy size into it */ + std::memcpy(temp_data.data() + 0, &data_size, sizeof(data_size)); /* Copy size into it */ std::memcpy(temp_data.data() + sizeof(data_size), &id, sizeof(id)); /* Copy id into it */ std::memcpy(temp_data.data() + sizeof(data_size) + sizeof(id), &type, sizeof(type)); /* Copy type into it */ std::memcpy(temp_data.data() + sizeof(data_size) + sizeof(id) + sizeof(type), data.data(), data.size()); /* Copy data into it */ diff --git a/unittest/test.cpp b/unittest/test.cpp index a7f920f..80c0577 100644 --- a/unittest/test.cpp +++ b/unittest/test.cpp @@ -10,7 +10,7 @@ int main() { rconpp::rcon_client client(std::getenv("RCON_TESTING_IP"), std::stoi(std::getenv("RCON_TESTING_PORT")), std::getenv("RCON_TESTING_PASSWORD")); - client.on_log = [](const std::string_view& log) { + client.on_log = [](const std::string_view log) { std::cout << log << "\n"; };