diff --git a/deps/fmt b/deps/fmt index 93975c70..d775a20f 160000 --- a/deps/fmt +++ b/deps/fmt @@ -1 +1 @@ -Subproject commit 93975c70bb373cd2d31361a1963384424aff0319 +Subproject commit d775a20fff0be6e087dd3a160e1b662606b9247e diff --git a/deps/mongoose b/deps/mongoose index fd839f18..2deaf084 160000 --- a/deps/mongoose +++ b/deps/mongoose @@ -1 +1 @@ -Subproject commit fd839f18275e5fde419497a254c129c6ad764b42 +Subproject commit 2deaf084e4dc0214be55b29f964c3d69bbdf6b21 diff --git a/deps/protobuf b/deps/protobuf index ff2a6600..b97a4a53 160000 --- a/deps/protobuf +++ b/deps/protobuf @@ -1 +1 @@ -Subproject commit ff2a6600e5df21683b86aca7e30bbb80c0aed848 +Subproject commit b97a4a53cdd55be74c30badefeb132a091764f53 diff --git a/src/Utils/String.hpp b/src/Utils/String.hpp index be6a283b..0a877ebd 100644 --- a/src/Utils/String.hpp +++ b/src/Utils/String.hpp @@ -12,10 +12,15 @@ namespace Utils static int g_vaNextBufferIndex = 0; char* buffer = g_vaBuffer[g_vaNextBufferIndex]; - std::string str = fmt::sprintf(message, std::forward(args)...); - strncpy_s(g_vaBuffer[g_vaNextBufferIndex], str.data(), VA_BUFFER_SIZE); g_vaNextBufferIndex = (g_vaNextBufferIndex + 1) % VA_BUFFER_COUNT; + std::string str = fmt::sprintf(message, std::forward(args)...); + + if (memmove_s(buffer, VA_BUFFER_SIZE, str.data(), str.size() + 1)) + { + *buffer = 0; // Error + } + return buffer; }