diff options
author | Trevor Saunders <tbsaunde+binutils@tbsaunde.org> | 2016-03-28 06:29:47 -0400 |
---|---|---|
committer | Trevor Saunders <tbsaunde+binutils@tbsaunde.org> | 2016-03-29 21:48:26 -0400 |
commit | 4ec9d7d56427e9fa49fd705599bb2ff0c3c5f3c1 (patch) | |
tree | 4fa49c4f304caa852769c4b8dc8e6a72700e54fd /gas/config/tc-hppa.c | |
parent | 49efcf2ab9736ced2c4dec927d25f48e072dbce4 (diff) | |
download | gdb-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-hppa.c')
-rw-r--r-- | gas/config/tc-hppa.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c index 48fdb0f..c2001bd 100644 --- a/gas/config/tc-hppa.c +++ b/gas/config/tc-hppa.c @@ -7300,8 +7300,7 @@ pa_space (int unused ATTRIBUTE_UNUSED) print_errors = 1; input_line_pointer = save_s; c = get_symbol_name (&name); - space_name = xmalloc (strlen (name) + 1); - strcpy (space_name, name); + space_name = xstrdup (name); (void) restore_line_pointer (c); sd_chain = pa_parse_space_stmt (space_name, 1); @@ -7365,8 +7364,7 @@ pa_subspace (int create_new) else { c = get_symbol_name (&name); - ss_name = xmalloc (strlen (name) + 1); - strcpy (ss_name, name); + ss_name = xstrdup (name); (void) restore_line_pointer (c); /* Load default values. */ @@ -7725,8 +7723,7 @@ create_new_space (char *name, as_fatal (_("Out of memory: could not allocate new space chain entry: %s\n"), name); - SPACE_NAME (chain_entry) = xmalloc (strlen (name) + 1); - strcpy (SPACE_NAME (chain_entry), name); + SPACE_NAME (chain_entry) = xstrdup (name); SPACE_DEFINED (chain_entry) = defined; SPACE_USER_DEFINED (chain_entry) = user_defined; SPACE_SPNUM (chain_entry) = spnum; @@ -7812,8 +7809,7 @@ create_new_subspace (sd_chain_struct *space, if (!chain_entry) as_fatal (_("Out of memory: could not allocate new subspace chain entry: %s\n"), name); - SUBSPACE_NAME (chain_entry) = xmalloc (strlen (name) + 1); - strcpy (SUBSPACE_NAME (chain_entry), name); + SUBSPACE_NAME (chain_entry) = xstrdup (name); /* Initialize subspace_defined. When we hit a .subspace directive we'll set it to 1 which "locks-in" the subspace attributes. */ |