summaryrefslogtreecommitdiff
path: root/ace/ARGV.cpp
diff options
context:
space:
mode:
authornaga <naga@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-09-15 21:30:10 +0000
committernaga <naga@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-09-15 21:30:10 +0000
commit7d251776e2b5e63a922731d20ad5bbaa59f21765 (patch)
treecc9df0bd39b597b1d5dd013e2ec654de99483fa5 /ace/ARGV.cpp
parent4269b8c86e4604467ab2a62578cd40988a8e9031 (diff)
downloadATCD-7d251776e2b5e63a922731d20ad5bbaa59f21765.tar.gz
*** empty log message ***
Diffstat (limited to 'ace/ARGV.cpp')
-rw-r--r--ace/ARGV.cpp11
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