diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-02-11 15:10:12 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-02-11 15:10:12 +0000 |
commit | 3e3c397d773b5858aa1b6446955d5318efe0526b (patch) | |
tree | eba861e3b264889540a440812ba909908349af34 | |
parent | d73f2619de9e72d5d98a730f8572324fa15113ad (diff) | |
download | binutils-3e3c397d773b5858aa1b6446955d5318efe0526b.tar.gz binutils-3e3c397d773b5858aa1b6446955d5318efe0526b.tar.bz2 binutils-3e3c397d773b5858aa1b6446955d5318efe0526b.zip |
bfd/
* oasys.c (oasys_write_header): Fix compilation warning on zero-sized
memset.
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/oasys.c | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1f8f30e6215..f2e40dda0f1 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2012-02-11 Jan Kratochvil <jan.kratochvil@redhat.com> + Nick Clifton <nickc@redhat.com> + + * oasys.c (oasys_write_header): Fix compilation warning on zero-sized + memset. + 2012-02-10 Iain Sandoe <idsandoe@googlemail.com> * mach-o.c (bfd_mach_o_build_seg_command): Count zerofill section diff --git a/bfd/oasys.c b/bfd/oasys.c index 11d24401fe1..ebb12e844e2 100644 --- a/bfd/oasys.c +++ b/bfd/oasys.c @@ -906,9 +906,11 @@ oasys_write_header (bfd *abfd) if (length > (size_t) sizeof (r.module_name)) length = sizeof (r.module_name); + else if (length < (size_t) sizeof (r.module_name)) + (void) memset (r.module_name + length, ' ', + sizeof (r.module_name) - length); (void) memcpy (r.module_name, abfd->filename, length); - (void) memset (r.module_name + length, ' ', sizeof (r.module_name) - length); r.version_number = OASYS_VERSION_NUMBER; r.rev_number = OASYS_REV_NUMBER; |