summaryrefslogtreecommitdiff
path: root/gcc/cppspec.c
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>1999-08-24 05:31:03 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>1999-08-24 05:31:03 +0000
commit9e1893a78dcf2e2c3a46a535dbd443dd190f8f63 (patch)
tree65c1bc06ee191d88af076a0a0eb3747e55e2a1ef /gcc/cppspec.c
parentdd294dca612eed87def675df8a3c05c329f59fa4 (diff)
downloadgcc-9e1893a78dcf2e2c3a46a535dbd443dd190f8f63.tar.gz
1999-08-23 22:23 -0700 Zack Weinberg <zack@bitmover.com>
* cppspec.c: Put a null pointer at the end of the new argv. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28813 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppspec.c')
-rw-r--r--gcc/cppspec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cppspec.c b/gcc/cppspec.c
index 4ab043d2158..01273054005 100644
--- a/gcc/cppspec.c
+++ b/gcc/cppspec.c
@@ -194,7 +194,8 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries)
if (new_argc == argc)
return;
- new_argv = (char **) xmalloc (new_argc * sizeof(char *));
+ /* One more slot for a terminating null. */
+ new_argv = (char **) xmalloc ((new_argc + 1) * sizeof(char *));
new_argv[0] = argv[0];
j = 1;
@@ -218,8 +219,9 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries)
}
if (read_stdin)
- new_argv[j] = "-";
+ new_argv[j++] = "-";
+ new_argv[j] = NULL;
*in_argc = new_argc;
*in_argv = new_argv;
}