summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2021-10-27 20:58:48 +0200
committerGitHub <noreply@github.com>2021-10-27 20:58:48 +0200
commitc484dae5dd082ea185786e8692cdf9f97d02fc95 (patch)
tree75022d50b5a78aade35253cc652133d9207e8142
parent4f43ab1824a8d6abe0a90129fb549b0c131e190c (diff)
parent15ea30ccfd13c9fc1ab5ad6a833b2b82df767796 (diff)
downloadATCD-c484dae5dd082ea185786e8692cdf9f97d02fc95.tar.gz
Merge pull request #1708 from jwillemsen/jwi-gccwarning
Make use of ACE_TString to get the subsection string to resolve gcc warning
-rw-r--r--ACE/ace/Configuration.cpp6
1 files changed, 5 insertions, 1 deletions
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;