aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-mips.c
diff options
context:
space:
mode:
authorTrevor Saunders <tbsaunde+binutils@tbsaunde.org>2016-03-28 06:29:47 -0400
committerTrevor Saunders <tbsaunde+binutils@tbsaunde.org>2016-03-29 21:48:26 -0400
commit4ec9d7d56427e9fa49fd705599bb2ff0c3c5f3c1 (patch)
tree4fa49c4f304caa852769c4b8dc8e6a72700e54fd /gas/config/tc-mips.c
parent49efcf2ab9736ced2c4dec927d25f48e072dbce4 (diff)
downloadgdb-4ec9d7d56427e9fa49fd705599bb2ff0c3c5f3c1.zip
gdb-4ec9d7d56427e9fa49fd705599bb2ff0c3c5f3c1.tar.gz
gdb-4ec9d7d56427e9fa49fd705599bb2ff0c3c5f3c1.tar.bz2
use xstrdup and friends more
gas/ChangeLog: 2016-03-29 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * config/tc-hppa.c (pa_space): Use xstrdup where appropriate. (pa_subspace): Likewise. (create_new_space): Likewise. (create_new_subspace): Likewise. * config/tc-mips.c (mips_lookup_insn): Likewise. * config/tc-tic4x.c (tic4x_asg): Likewise. * config/tc-tic54x.c (tic54x_eval): Likewise. (stag_add_field): Likewise. (tic54x_usect): Likewise. (tic54x_clink): Likewise. (tic54x_set_default_include): Likewise. (tic54x_include): Likewise. (tic54x_message): Likewise. (tic54x_sblock): Likewise. (tic54x_var): Likewise. (subsym_ismember): Likewise. (subsym_substitute): Likewise. * config/tc-xtensa.c (xg_replace_opname): Likewise. (xg_translate_sysreg_op): Likewise. (xg_translate_idioms): Likewise. (md_assemble): Likewise. (cache_literal_section): Likewise.
Diffstat (limited to 'gas/config/tc-mips.c')
-rw-r--r--gas/config/tc-mips.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 9679a5e..f2b81f2 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -13531,9 +13531,7 @@ mips_lookup_insn (struct hash_control *hash, const char *start,
struct mips_opcode *insn;
/* Make a copy of the instruction so that we can fiddle with it. */
- name = xmalloc (length + 1);
- memcpy (name, start, length);
- name[length] = '\0';
+ name = xstrndup (start, length);
/* Look up the instruction as-is. */
insn = (struct mips_opcode *) hash_find (hash, name);