Commit 3ed4f5ed by Zack Weinberg Committed by Zack Weinberg

cppspec.c: Put a null pointer at the end of the new argv.

1999-08-23 22:23 -0700  Zack Weinberg  <zack@bitmover.com>

	* cppspec.c: Put a null pointer at the end of the new argv.

From-SVN: r28813
parent 732d9b8c
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) Mon Aug 23 21:23:24 1999 Jeffrey A Law (law@cygnus.com)
* configure.in: Remove code to select/de-select the haifa * configure.in: Remove code to select/de-select the haifa
......
...@@ -194,7 +194,8 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries) ...@@ -194,7 +194,8 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries)
if (new_argc == argc) if (new_argc == argc)
return; 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]; new_argv[0] = argv[0];
j = 1; j = 1;
...@@ -218,8 +219,9 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries) ...@@ -218,8 +219,9 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries)
} }
if (read_stdin) if (read_stdin)
new_argv[j] = "-"; new_argv[j++] = "-";
new_argv[j] = NULL;
*in_argc = new_argc; *in_argc = new_argc;
*in_argv = new_argv; *in_argv = new_argv;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment