Commit 853f1cc3 by Richard Kenner

(process_command): Fix improper use of strncpy.

From-SVN: r13574
parent dd05a7e7
/* Compiler driver program that can handle many languages.
Copyright (C) 1987, 89, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 1987, 89, 92-96, 1997 Free Software Foundation, Inc.
This file is part of GNU CC.
......@@ -2540,9 +2540,9 @@ process_command (argc, argv)
1, 0, NULL_PTR);
else
{
char *string = xmalloc (len + 1);
char *string = xmalloc (len);
strncpy (string, value, len-7);
strcat (string, "include");
strcpy (string+len-7, "include");
add_prefix (&include_prefixes, string,
1, 0, NULL_PTR);
}
......
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