aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-arc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/config/tc-arc.c')
-rw-r--r--gas/config/tc-arc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index b64174f..67c0ec2 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -2262,9 +2262,7 @@ md_assemble (char *str)
/* Split off the opcode. */
opnamelen = strspn (str, "abcdefghijklmnopqrstuvwxyz_0123468");
- opname = xmalloc (opnamelen + 1);
- memcpy (opname, str, opnamelen);
- opname[opnamelen] = '\0';
+ opname = xmemdup0 (str, opnamelen);
/* Signalize we are assmbling the instructions. */
assembling_insn = TRUE;