aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/xref.c9
2 files changed, 5 insertions, 8 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d827330..31019b2 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2001-04-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * xref.c (GNU_xref_file): Use concat in lieu of xmalloc/sprintf.
+
2001-04-23 Jason Merrill <jason_merrill@redhat.com>
* except.c (build_throw): Wrap the initialization of the exception
diff --git a/gcc/cp/xref.c b/gcc/cp/xref.c
index cf99fcd..af35020 100644
--- a/gcc/cp/xref.c
+++ b/gcc/cp/xref.c
@@ -205,14 +205,7 @@ GNU_xref_file (name)
if (FILE_NAME_ABSOLUTE_P (name) || ! wd_name)
xf->outname = xf->name;
else
- {
- char *nmbuf
- = (char *) xmalloc (strlen (wd_name) + strlen (FILE_NAME_JOINER)
- + strlen (name) + 1);
- sprintf (nmbuf, "%s%s%s", wd_name, FILE_NAME_JOINER, name);
- name = nmbuf;
- xf->outname = nmbuf;
- }
+ xf->outname = name = concat (wd_name, FILE_NAME_JOINER, name, NULL);
fprintf (xref_file, "FIL %s %s 0\n", name, wd_name);