From b50afec9dd7ea2dfffbe4ac9e89ecf404865523a Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 21 Oct 2002 10:58:42 +0000 Subject: [PATCH] * targets.c (bfd_target_list): Don't return the default target twice. --- bfd/ChangeLog | 4 ++++ bfd/targets.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c56f0ece595..9da22b645a5 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2002-10-21 Alan Modra + + * targets.c (bfd_target_list): Don't return the default target twice. + 2002-10-21 Elias Athanasopoulos * archive.c (_bfd_archive_bsd_update_armap_timestamp): Replace 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; } -- 2.30.2