aboutsummaryrefslogtreecommitdiff
path: root/bfd/targets.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-10-21 10:58:42 +0000
committerAlan Modra <amodra@gmail.com>2002-10-21 10:58:42 +0000
commitb50afec9dd7ea2dfffbe4ac9e89ecf404865523a (patch)
tree064418a3bc7e9378b470a105fcf29f48a557e19b /bfd/targets.c
parentab9bcc017ff7cd4826d96f799cbfc9a0be7487f6 (diff)
downloadgdb-b50afec9dd7ea2dfffbe4ac9e89ecf404865523a.zip
gdb-b50afec9dd7ea2dfffbe4ac9e89ecf404865523a.tar.gz
gdb-b50afec9dd7ea2dfffbe4ac9e89ecf404865523a.tar.bz2
* targets.c (bfd_target_list): Don't return the default target twice.
Diffstat (limited to 'bfd/targets.c')
-rw-r--r--bfd/targets.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/bfd/targets.c b/bfd/targets.c
index adc8bd6..5d778c8 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -1273,14 +1273,17 @@ bfd_target_list ()
vec_length++;
amt = (vec_length + 1) * sizeof (char **);
- name_ptr = name_list = (const char **) bfd_zmalloc (amt);
+ name_ptr = name_list = (const char **) bfd_malloc (amt);
if (name_list == NULL)
return NULL;
for (target = &bfd_target_vector[0]; *target != NULL; target++)
- *(name_ptr++) = (*target)->name;
+ if (target == &bfd_target_vector[0]
+ || *target != bfd_target_vector[0])
+ *name_ptr++ = (*target)->name;
+ *name_ptr = NULL;
return name_list;
}