From 0c2228f586a6c8fda87b707fcdaf2e861e118eff Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Wed, 27 Oct 2021 13:38:09 +0200 Subject: Make use of ACE_TString to get the subsection string to resolve gcc warning on memcpy * ACE/ace/Configuration.cpp: --- ACE/ace/Configuration.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ACE/ace/Configuration.cpp b/ACE/ace/Configuration.cpp index 6aeccdfea9b..880ed6e8d41 100644 --- a/ACE/ace/Configuration.cpp +++ b/ACE/ace/Configuration.cpp @@ -1508,7 +1508,11 @@ ACE_Configuration_Heap::open_section (const ACE_Configuration_Section_Key& base, (separator = ACE_OS::strchr (sub_section, ACE_TEXT ('\\'))) != nullptr; ) { - ACE_TString const simple_section (sub_section, separator - sub_section); + // Create a substring from the current location until the new found separator + // Because ACE_TString works with the character length we need to keep in mind + // the size of a single character + ACE_TString tsub_section (sub_section); + ACE_TString const simple_section = tsub_section.substring(0, (separator - sub_section) / sizeof (ACE_TCHAR)); int const ret_val = open_simple_section (result, simple_section.c_str(), create, result); if (ret_val) return ret_val; -- cgit v1.2.1