From 3e3c397d773b5858aa1b6446955d5318efe0526b Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Sat, 11 Feb 2012 15:10:12 +0000 Subject: [PATCH] bfd/ * oasys.c (oasys_write_header): Fix compilation warning on zero-sized memset. --- bfd/ChangeLog | 6 ++++++ bfd/oasys.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) 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 + Nick Clifton + + * oasys.c (oasys_write_header): Fix compilation warning on zero-sized + memset. + 2012-02-10 Iain Sandoe * 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; -- 2.30.2