From 7d251776e2b5e63a922731d20ad5bbaa59f21765 Mon Sep 17 00:00:00 2001 From: naga Date: Tue, 15 Sep 1998 21:30:10 +0000 Subject: *** empty log message *** --- ace/ARGV.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ace/ARGV.cpp') 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 -- cgit v1.2.1