diff options
author | Chad Elliott <elliottc@objectcomputing.com> | 2022-12-08 06:48:29 -0600 |
---|---|---|
committer | Chad Elliott <elliottc@objectcomputing.com> | 2022-12-08 06:48:29 -0600 |
commit | d521401c4965b313d53ed1be3be313c8c360df8e (patch) | |
tree | b6ce0e80844238498d9d2adcf1856857cc791381 | |
parent | a824af374a4ed77a7a4f603675680e395b87cdc9 (diff) | |
download | ATCD-d521401c4965b313d53ed1be3be313c8c360df8e.tar.gz |
Pulled in 0c2228f586a6c8fda87b707fcdaf2e861e118eff from master.
-rw-r--r-- | ACE/ace/Configuration.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ACE/ace/Configuration.cpp b/ACE/ace/Configuration.cpp index 10b0ad2b05b..ee492ccefef 100644 --- a/ACE/ace/Configuration.cpp +++ b/ACE/ace/Configuration.cpp @@ -1537,9 +1537,12 @@ ACE_Configuration_Heap::open_section (const ACE_Configuration_Section_Key& base, (separator = ACE_OS::strchr (sub_section, ACE_TEXT ('\\'))) != 0; ) { - ACE_TString simple_section (sub_section, separator - sub_section); - int ret_val = - open_simple_section (result, simple_section.c_str (), create, result); + // 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; sub_section = separator + 1; |