diff options
author | Steve Huston <shuston@riverace.com> | 2014-10-11 21:15:17 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2014-10-11 21:15:17 +0000 |
commit | 6c9478f1075e70a6a094cde31653a8631847df80 (patch) | |
tree | 999db1534d7fcde06efbfd313b00a6cad2953920 /ACE/ace/Process.cpp | |
parent | 268ee85a72f9d41a122fca347fe535d69b6114d4 (diff) | |
download | ATCD-6c9478f1075e70a6a094cde31653a8631847df80.tar.gz |
ChangeLogTag:Sat Oct 1 21:09:07 UTC 2014 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ACE/ace/Process.cpp')
-rw-r--r-- | ACE/ace/Process.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/ACE/ace/Process.cpp b/ACE/ace/Process.cpp index 2a074f536db..9fc931a3128 100644 --- a/ACE/ace/Process.cpp +++ b/ACE/ace/Process.cpp @@ -962,17 +962,32 @@ ACE_Process_Options::setenv (const ACE_TCHAR *format, ...) { ACE_TCHAR stack_buf[DEFAULT_COMMAND_LINE_BUF_LEN]; + int status; // Start varargs. va_list argp; va_start (argp, format); // Add the rest of the varargs. - ACE_OS::vsprintf (stack_buf, - format, - argp); + // At the time of this writing, only one platform does not support + // vsnprintf (LynxOS). Should we get to the point where no platform + // sets ACE_LACKS_VSNPRINTF, this condition can be removed. +#if defined (ACE_LACKS_VSNPRINTF) + status = ACE_OS::vsprintf (stack_buf, + format, + argp); +#else + status = ACE_OS::vsnprintf (stack_buf, + DEFAULT_COMMAND_LINE_BUF_LEN, + format, + argp); +#endif /* ACE_LACKS_VSNPRINTF */ + // End varargs. va_end (argp); + if (status == -1) + return -1; + // Append the string to are environment buffer. if (this->setenv_i (stack_buf, ACE_OS::strlen (stack_buf)) == -1) |