From: Andrew Burgess Date: Wed, 15 Sep 2021 10:24:49 +0000 (+0100) Subject: bfd: fix incorrect type used in sizeof X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b4745472b686482107c1a8d65ae99a434cd3fb5e;p=binutils-gdb.git bfd: fix incorrect type used in sizeof 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. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index a69b50c6199..83d3f637022 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2021-09-15 Andrew Burgess + + * archures.c (bfd_arch_list): Use 'char *' instead of 'char **' + when calculating space for a string list. + 2021-09-014 Cupertino Miranda Claudiu Zissulescu 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;