summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/cppspec.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0b58e4d8123..3b77de2c471 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+1999-08-23 22:23 -0700 Zack Weinberg <zack@bitmover.com>
+
+ * cppspec.c: Put a null pointer at the end of the new argv.
+
Mon Aug 23 21:23:24 1999 Jeffrey A Law (law@cygnus.com)
* configure.in: Remove code to select/de-select the haifa
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;
}