aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-tic30.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/config/tc-tic30.c')
-rw-r--r--gas/config/tc-tic30.c8
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);