From 7f951dadbd238126cc16ca3767f431f18bac5993 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Thu, 25 Aug 2016 13:25:23 +0200 Subject: [PATCH] Update dependencies --- deps/fmt | 2 +- deps/mongoose | 2 +- deps/protobuf | 2 +- src/Utils/String.hpp | 9 +++++++-- 4 files changed, 10 insertions(+), 5 deletions(-) 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; }