aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-12-16 18:56:33 +0000
committerChristopher Faylor <me@cgf.cx>2002-12-16 18:56:33 +0000
commit9ec7b58c62852273dd05c964a00c42f0524c689d (patch)
tree501093cdd872a1934efdf164e5719a37cf0f24c9
parent84c221c08ea504dc8f20132e0e7107eb643aee4e (diff)
downloadnewlib-9ec7b58c62852273dd05c964a00c42f0524c689d.zip
newlib-9ec7b58c62852273dd05c964a00c42f0524c689d.tar.gz
newlib-9ec7b58c62852273dd05c964a00c42f0524c689d.tar.bz2
* pinfo.cc (_pinfo::cmdline): Allocate sufficient space for myself command line
args.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/pinfo.cc2
2 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index c19dfdb..4a5bf42 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2002-12-16 Christopher Faylor <cgf@redhat.com>
+
+ * pinfo.cc (_pinfo::cmdline): Allocate sufficient space for myself
+ command line args.
+
2002-12-14 Steve Osborn <bub@io.com>
* fhandler_termios.cc (fhandler_termios::line_edit): Call
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 75b71f2..3c5af4b 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -444,7 +444,7 @@ _pinfo::cmdline (size_t& n)
{
n = 1;
for (char **a = __argv; *a; a++)
- n += strlen (*a);
+ n += strlen (*a) + 1;
char *p;
p = s = (char *) malloc (n);
for (char **a = __argv; *a; a++)