aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-tic54x.c
diff options
context:
space:
mode:
authorTrevor Saunders <tbsaunde+binutils@tbsaunde.org>2016-05-18 22:48:34 -0400
committerTrevor Saunders <tbsaunde+binutils@tbsaunde.org>2016-05-23 01:21:07 -0400
commitf10e0aef4f9cb98d8c49c237ef3987f0ca3ee90f (patch)
treee6216b8a13fccaafe97d0f0155e9c6d5b0bf1592 /gas/config/tc-tic54x.c
parent2900e701e0f0216b17e04e4fff1ca4711a9c072f (diff)
downloadgdb-f10e0aef4f9cb98d8c49c237ef3987f0ca3ee90f.zip
gdb-f10e0aef4f9cb98d8c49c237ef3987f0ca3ee90f.tar.gz
gdb-f10e0aef4f9cb98d8c49c237ef3987f0ca3ee90f.tar.bz2
tic54x: use concat more
gas/ChangeLog: 2016-05-23 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * config/tc-tic54x.c (tic54x_sect): simplify string creation.
Diffstat (limited to 'gas/config/tc-tic54x.c')
-rw-r--r--gas/config/tc-tic54x.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gas/config/tc-tic54x.c b/gas/config/tc-tic54x.c
index 3936c97..947ba73 100644
--- a/gas/config/tc-tic54x.c
+++ b/gas/config/tc-tic54x.c
@@ -1161,28 +1161,27 @@ tic54x_sect (int arg)
{
char *name = NULL;
int len;
+ /* Make sure all named initialized sections flagged properly. If we
+ encounter instructions, we'll flag it with SEC_CODE as well. */
+ const char *flags = ",\"w\"\n";
/* If there are quotes, remove them. */
if (*input_line_pointer == '"')
{
name = demand_copy_C_string (&len);
demand_empty_rest_of_line ();
- name = strcpy (xmalloc (len + 10), name);
+ name = concat (name, flags, (char *) NULL);
}
else
{
int c;
c = get_symbol_name (&name);
- len = strlen(name);
- name = strcpy (xmalloc (len + 10), name);
+ name = concat (name, flags, (char *) NULL);
(void) restore_line_pointer (c);
demand_empty_rest_of_line ();
}
- /* Make sure all named initialized sections flagged properly. If we
- encounter instructions, we'll flag it with SEC_CODE as well. */
- strcat (name, ",\"w\"\n");
input_scrub_insert_line (name);
obj_coff_section (0);