From e66f6c11406bb9846b7004609fbe50eb735be1ce Mon Sep 17 00:00:00 2001 From: Ruakij Date: Mon, 22 Nov 2021 10:28:23 +0100 Subject: [PATCH] Fixed strcopy being wrong way around --- handler/asyncHandler.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/handler/asyncHandler.hpp b/handler/asyncHandler.hpp index 4b4a7fb..700db67 100644 --- a/handler/asyncHandler.hpp +++ b/handler/asyncHandler.hpp @@ -6,11 +6,12 @@ #include "bufHandler.hpp" void asyncHandler(char *buf){ - // Create a copy of buf for our thread - char bufCopy[265]; - strcpy(buf, bufCopy); + // Create a copy of buf for our thread + char bufCopy[265]; + strcpy(bufCopy, buf); + + // \/ Surpress unused warning + (void)std::async(std::launch::async, bufHandler, bufCopy); +} - // \/ Surpress unused warning - (void)std::async(std::launch::async, bufHandler, bufCopy); - } #endif /* EFFCCB40_3639_4BD4_9649_302F05987909 */