Use obstack_strdup more
[deliverable/binutils-gdb.git] / gdb / buildsym.c
index 9a23c8f52545299e664138163184334be7533bd3..8e05706c4be7ead2ce8dbae8d76f7c7c2a60e6a7 100644 (file)
@@ -1031,9 +1031,8 @@ buildsym_compunit::end_symtab_with_blockvector (struct block *static_block,
     {
       /* Reallocate the dirname on the symbol obstack.  */
       const char *comp_dir = m_comp_dir.get ();
-      COMPUNIT_DIRNAME (cu)
-       = (const char *) obstack_copy0 (&m_objfile->objfile_obstack,
-                                       comp_dir, strlen (comp_dir));
+      COMPUNIT_DIRNAME (cu) = obstack_strdup (&m_objfile->objfile_obstack,
+                                             comp_dir);
     }
 
   /* Save the debug format string (if any) in the symtab.  */
This page took 0.023963 seconds and 4 git commands to generate.