aboutsummaryrefslogtreecommitdiff
path: root/gcc/f/com.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2001-04-23 00:36:28 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2001-04-23 00:36:28 +0000
commitd4c3ec27386c2b61e46604c0674dbb1dac004310 (patch)
tree790252fc6f2f85414e4da728fab71c76dd6c9020 /gcc/f/com.c
parent2ac8a0f9c2464064ba2eb5cd9d63a4f8d6e3525b (diff)
downloadgcc-d4c3ec27386c2b61e46604c0674dbb1dac004310.zip
gcc-d4c3ec27386c2b61e46604c0674dbb1dac004310.tar.gz
gcc-d4c3ec27386c2b61e46604c0674dbb1dac004310.tar.bz2
collect2.c (main): Use concat in lieu of xmalloc/sprintf.
* collect2.c (main): Use concat in lieu of xmalloc/sprintf. (write_c_file_stat): Likewise. * dbxout.c (dbxout_init): Likewise. * profile.c (output_func_start_profiler): Likewise. cp: * xref.c (GNU_xref_file): Use concat in lieu of xmalloc/sprintf. f: * com.c (ffecom_subscript_check_): Use concat in lieu of xmalloc/sprintf. java: * jvspec.c (lang_specific_driver): Fix memory allocation deficit, by using concat in lieu of xmalloc/sprintf. From-SVN: r41495
Diffstat (limited to 'gcc/f/com.c')
-rw-r--r--gcc/f/com.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/gcc/f/com.c b/gcc/f/com.c
index 52843e3..87d63f0 100644
--- a/gcc/f/com.c
+++ b/gcc/f/com.c
@@ -694,10 +694,8 @@ ffecom_subscript_check_ (tree array, tree element, int dim, int total_dims,
switch (total_dims)
{
case 0:
- var = xmalloc (strlen (array_name) + 20);
- sprintf (var, "%s[%s-substring]",
- array_name,
- dim ? "end" : "start");
+ var = concat (array_name, "[", (dim ? "end" : "start"),
+ "-substring]", NULL);
len = strlen (var) + 1;
arg1 = build_string (len, var);
free (var);
@@ -740,13 +738,10 @@ ffecom_subscript_check_ (tree array, tree element, int dim, int total_dims,
convert (TREE_TYPE (element),
integer_one_node)));
- proc = xmalloc ((len = strlen (input_filename)
- + IDENTIFIER_LENGTH (DECL_NAME (current_function_decl))
- + 2));
-
- sprintf (&proc[0], "%s/%s",
- input_filename,
- IDENTIFIER_POINTER (DECL_NAME (current_function_decl)));
+ proc = concat (input_filename, "/",
+ IDENTIFIER_POINTER (DECL_NAME (current_function_decl)),
+ NULL);
+ len = strlen (proc) + 1;
arg3 = build_string (len, proc);
free (proc);