aboutsummaryrefslogtreecommitdiff
path: root/gdb/namespace.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/namespace.c')
-rw-r--r--gdb/namespace.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/gdb/namespace.c b/gdb/namespace.c
index 62c7214..04b49ef 100644
--- a/gdb/namespace.c
+++ b/gdb/namespace.c
@@ -87,10 +87,8 @@ add_using_directive (struct using_direct **using_directives,
if (copy_names)
{
- newobj->import_src
- = (const char *) obstack_copy0 (obstack, src, strlen (src));
- newobj->import_dest
- = (const char *) obstack_copy0 (obstack, dest, strlen (dest));
+ newobj->import_src = obstack_strdup (obstack, src);
+ newobj->import_dest = obstack_strdup (obstack, dest);
}
else
{
@@ -99,15 +97,12 @@ add_using_directive (struct using_direct **using_directives,
}
if (alias != NULL && copy_names)
- newobj->alias
- = (const char *) obstack_copy0 (obstack, alias, strlen (alias));
+ newobj->alias = obstack_strdup (obstack, alias);
else
newobj->alias = alias;
if (declaration != NULL && copy_names)
- newobj->declaration
- = (const char *) obstack_copy0 (obstack, declaration,
- strlen (declaration));
+ newobj->declaration = obstack_strdup (obstack, declaration);
else
newobj->declaration = declaration;