diff options
author | Alan Modra <amodra@bigpond.net.au> | 2002-10-21 10:58:42 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2002-10-21 10:58:42 +0000 |
commit | de8947bb4983652679f007891e28757e09842f64 (patch) | |
tree | 88b535cafa72a4223dce0d0429a426798f667cdb /bfd/targets.c | |
parent | a3550054aa10f8377ddd883b0cb97a5f51d0e2ef (diff) | |
download | gdb-de8947bb4983652679f007891e28757e09842f64.tar.gz |
* targets.c (bfd_target_list): Don't return the default target twice.
Diffstat (limited to 'bfd/targets.c')
-rw-r--r-- | bfd/targets.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bfd/targets.c b/bfd/targets.c index adc8bd638ec..5d778c8bc3a 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; } |