diff options
author | Tom Tromey <tromey@redhat.com> | 2013-11-25 07:40:05 -0700 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-12-06 12:13:37 -0700 |
commit | 8e96694e31aedc28a4e2a00b28099158a8bd4a5a (patch) | |
tree | 24513091efce83803d43f79eda257ada0b1d358d /gdb/buildsym.c | |
parent | 21ea9eece76627d5f71f6a755ea3fc7b2916db72 (diff) | |
download | gdb-8e96694e31aedc28a4e2a00b28099158a8bd4a5a.zip gdb-8e96694e31aedc28a4e2a00b28099158a8bd4a5a.tar.gz gdb-8e96694e31aedc28a4e2a00b28099158a8bd4a5a.tar.bz2 |
make symtab::dirname const
This makes symtab::dirname const and updates one spot to avoid an
intermediate constless result.
2013-12-06 Tom Tromey <tromey@redhat.com>
* buildsym.c (end_symtab_from_static_block): Use obstack_copy0.
* symtab.h (struct symtab) <dirname>: Now const.
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r-- | gdb/buildsym.c | 8 |
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 { |