summaryrefslogtreecommitdiff
path: root/gas/config/tc-tic4x.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-tic4x.c
parent49efcf2ab9736ced2c4dec927d25f48e072dbce4 (diff)
downloadbinutils-gdb-4ec9d7d56427e9fa49fd705599bb2ff0c3c5f3c1.tar.gz
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-tic4x.c')
-rw-r--r--gas/config/tc-tic4x.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/gas/config/tc-tic4x.c b/gas/config/tc-tic4x.c
index 956ea5d9d6c..a833c525cd3 100644
--- a/gas/config/tc-tic4x.c
+++ b/gas/config/tc-tic4x.c
@@ -713,7 +713,6 @@ tic4x_asg (int x ATTRIBUTE_UNUSED)
char c;
char *name;
char *str;
- char *tmp;
SKIP_WHITESPACE ();
str = input_line_pointer;
@@ -728,12 +727,8 @@ tic4x_asg (int x ATTRIBUTE_UNUSED)
}
*input_line_pointer++ = '\0';
c = get_symbol_name (&name); /* Get terminator. */
- tmp = xmalloc (strlen (str) + 1);
- strcpy (tmp, str);
- str = tmp;
- tmp = xmalloc (strlen (name) + 1);
- strcpy (tmp, name);
- name = tmp;
+ str = xstrdup (str);
+ name = xstrdup (name);
if (hash_find (tic4x_asg_hash, name))
hash_replace (tic4x_asg_hash, name, (void *) str);
else