Skip to content

Commit 89de0eb

Browse files
author
Viktor Chernenko
committed
While using ACE_Wide_To_Ascii string conversion class (and correspondingly ::WideCharToMultiByte) there must be expected that the length of the ouput multi-byte string is not equal to the length of the input unicode string. That's why we the variable iter used to iterate over the original unicode environment varaiables must be increased by the source string length (and not by the length of converted string).
1 parent 6756ee1 commit 89de0eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ACE/ace/Process.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ ACE_Process_Options::inherit_environment ()
932932
size_t const idx = temp_narrow_env.size ();
933933
temp_narrow_env.resize (idx + len + 1, 0);
934934
ACE_OS::strncpy (&temp_narrow_env[idx], wta.char_rep (), len);
935-
iter += len;
935+
iter += ACE_OS::strlen(iter);
936936
}
937937
temp_narrow_env.push_back (0);
938938
existing_environment = &temp_narrow_env[0];

0 commit comments

Comments
 (0)