aboutsummaryrefslogtreecommitdiff
path: root/gdb/buildsym.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r--gdb/buildsym.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 0326e26..8d9bdb1 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -1204,10 +1204,10 @@ end_symtab_from_static_block (struct block *static_block,
if (subfile->dirname)
{
/* Reallocate the dirname on the symbol obstack. */
- symtab->dirname = (char *)
- obstack_alloc (&objfile->objfile_obstack,
- strlen (subfile->dirname) + 1);
- strcpy (symtab->dirname, subfile->dirname);
+ symtab->dirname =
+ obstack_copy0 (&objfile->objfile_obstack,
+ subfile->dirname,
+ strlen (subfile->dirname));
}
else
{