diff options
author | naga <naga@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-09-15 21:30:10 +0000 |
---|---|---|
committer | naga <naga@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-09-15 21:30:10 +0000 |
commit | 7d251776e2b5e63a922731d20ad5bbaa59f21765 (patch) | |
tree | cc9df0bd39b597b1d5dd013e2ec654de99483fa5 /ace/ARGV.cpp | |
parent | 4269b8c86e4604467ab2a62578cd40988a8e9031 (diff) | |
download | ATCD-7d251776e2b5e63a922731d20ad5bbaa59f21765.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace/ARGV.cpp')
-rw-r--r-- | ace/ARGV.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ace/ARGV.cpp b/ace/ARGV.cpp index a2da03c68cf..a16fcb61a12 100644 --- a/ace/ARGV.cpp +++ b/ace/ARGV.cpp @@ -197,6 +197,8 @@ ACE_ARGV::argv_to_string (ASYS_TCHAR **argv,ASYS_TCHAR *&buf) ACE_NEW_RETURN (buf, ASYS_TCHAR[buf_len + 1],0); + // initial null charater to make it a null string. + buf[0] = '\0'; ASYS_TCHAR *end = buf; int j; @@ -212,8 +214,8 @@ ACE_ARGV::argv_to_string (ASYS_TCHAR **argv,ASYS_TCHAR *&buf) else end = ACE::strecpy (end, argv[j]); - // Add white space and advance the pointer. - *end++ = ' '; + // Replace the null char that strecpy put there with white space. + *(end-1) = ' '; } // Null terminate the string. *end = '\0'; @@ -300,8 +302,9 @@ ACE_ARGV::ACE_ARGV (ASYS_TCHAR *argv[], else end = ACE::strecpy (end, argv[j]); - // Add white space and advance the pointer. - *end++ = ' '; + // Replace the null char that strecpy copies with white space as + // a separator. + *(end-1) = ' '; } // Remember how many arguments there are |