diff options
author | Trevor Saunders <tbsaunde+binutils@tbsaunde.org> | 2016-04-02 09:27:18 -0400 |
---|---|---|
committer | Trevor Saunders <tbsaunde+binutils@tbsaunde.org> | 2016-04-03 19:52:25 -0400 |
commit | a44e2901c749445d16ba1e3875b50af9c4bbb3c5 (patch) | |
tree | 0fd9f6c7f0d43ddf168426ac7227db2ebe027412 /gas/config/tc-tic30.c | |
parent | ae2689b09ff821b285159db064705068bb4cfa02 (diff) | |
download | gdb-a44e2901c749445d16ba1e3875b50af9c4bbb3c5.zip gdb-a44e2901c749445d16ba1e3875b50af9c4bbb3c5.tar.gz gdb-a44e2901c749445d16ba1e3875b50af9c4bbb3c5.tar.bz2 |
use xstrdup and friends more
gas/ChangeLog:
2016-04-03 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* config/obj-elf.c (obj_elf_vendor_attribute): Use xstrdup.
* config/tc-ppc.c (ppc_frob_file_before_adjust): Likewise.
(ppc_znop): Likewise.
(ppc_pe_section): Likewise.
(ppc_frob_symbol): Likewise.
* config/tc-tic30.c (tic30_operand): Likewise.
* config/tc-tic4x.c (tic4x_sect): Likewise.
(tic4x_usect): Likewise.
Diffstat (limited to 'gas/config/tc-tic30.c')
-rw-r--r-- | gas/config/tc-tic30.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/gas/config/tc-tic30.c b/gas/config/tc-tic30.c index 71c6249..10653ed 100644 --- a/gas/config/tc-tic30.c +++ b/gas/config/tc-tic30.c @@ -604,9 +604,7 @@ tic30_operand (char *token) segT retval; debug ("Probably a label: %s\n", token); - current_op->immediate.label = malloc (strlen (token) + 1); - strcpy (current_op->immediate.label, token); - current_op->immediate.label[strlen (token)] = '\0'; + current_op->immediate.label = xstrdup (token); save_input_line_pointer = input_line_pointer; input_line_pointer = token; @@ -634,9 +632,7 @@ tic30_operand (char *token) for (count = 0; count < strlen (token); count++) if (*(token + count) == '.') current_op->immediate.decimal_found = 1; - current_op->immediate.label = malloc (strlen (token) + 1); - strcpy (current_op->immediate.label, token); - current_op->immediate.label[strlen (token)] = '\0'; + current_op->immediate.label = xstrdup (token); current_op->immediate.f_number = (float) atof (token); current_op->immediate.s_number = (int) atoi (token); current_op->immediate.u_number = (unsigned int) atoi (token); |