aboutsummaryrefslogtreecommitdiff
path: root/gas/config/obj-evax.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/config/obj-evax.c')
-rw-r--r--gas/config/obj-evax.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gas/config/obj-evax.c b/gas/config/obj-evax.c
index e368592..4458286 100644
--- a/gas/config/obj-evax.c
+++ b/gas/config/obj-evax.c
@@ -273,9 +273,7 @@ evax_shorten_name (char *id)
}
/* We only need worry about krunching the base symbol. */
- base_id = xmalloc (suffix_dotdot - prefix_dotdot + 1);
- strncpy (base_id, &id[prefix_dotdot], suffix_dotdot - prefix_dotdot);
- base_id [suffix_dotdot - prefix_dotdot] = 0;
+ base_id = xmemdup0 (&id[prefix_dotdot], suffix_dotdot - prefix_dotdot);
if (strlen (base_id) > MAX_LABEL_LENGTH)
{
@@ -299,8 +297,7 @@ evax_shorten_name (char *id)
strcat (new_id, suffix);
/* Save it on the heap and return. */
- return_id = xmalloc (strlen (new_id) + 1);
- strcpy (return_id, new_id);
+ return_id = xstrdup (new_id);
return return_id;
}