[PUSHED] bfd: fix incorrect type used in sizeof

Message ID 20210915103332.1708757-1-andrew.burgess@embecosm.com
State New
Headers show
Series
  • [PUSHED] bfd: fix incorrect type used in sizeof
Related show

Commit Message

Andrew Burgess Sept. 15, 2021, 10:33 a.m.
Noticed in passing that we used 'sizeof (char **)' when calculating
the size of a list of 'char *' pointers.  Of course, this isn't really
going to make a difference anywhere, but we may as well be correct.

There should be no user visible changes after this commit.

bfd/ChangeLog:

	* archures.c (bfd_arch_list): Use 'char *' instead of 'char **'
	when calculating space for a string list.
---
 bfd/ChangeLog  | 5 +++++
 bfd/archures.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

-- 
2.25.4

Patch

diff --git a/bfd/archures.c b/bfd/archures.c
index 390691bfba1..31a41a1d863 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -864,7 +864,7 @@  bfd_arch_list (void)
 	}
     }
 
-  amt = (vec_length + 1) * sizeof (char **);
+  amt = (vec_length + 1) * sizeof (char *);
   name_list = (const char **) bfd_malloc (amt);
   if (name_list == NULL)
     return NULL;