diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-09-15 11:24:49 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-09-15 11:32:33 +0100 |
commit | b4745472b686482107c1a8d65ae99a434cd3fb5e (patch) | |
tree | 0d2222080a4f7728666d1879f7c151396398a1a7 /bfd | |
parent | 3d53d4603eb467b90b81562a6f0f6d5259793944 (diff) | |
download | gdb-b4745472b686482107c1a8d65ae99a434cd3fb5e.zip gdb-b4745472b686482107c1a8d65ae99a434cd3fb5e.tar.gz gdb-b4745472b686482107c1a8d65ae99a434cd3fb5e.tar.bz2 |
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.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/archures.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index a69b50c..83d3f63 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2021-09-15 Andrew Burgess <andrew.burgess@embecosm.com> + + * archures.c (bfd_arch_list): Use 'char *' instead of 'char **' + when calculating space for a string list. + 2021-09-014 Cupertino Miranda <cmiranda@synopsys.com> Claudiu Zissulescu <claziss@synopsys.com> diff --git a/bfd/archures.c b/bfd/archures.c index 390691b..31a41a1 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; |