aboutsummaryrefslogtreecommitdiff
path: root/bfd/oasys.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-02-11 15:10:12 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-02-11 15:10:12 +0000
commit3e3c397d773b5858aa1b6446955d5318efe0526b (patch)
treeeba861e3b264889540a440812ba909908349af34 /bfd/oasys.c
parentd73f2619de9e72d5d98a730f8572324fa15113ad (diff)
downloadgdb-3e3c397d773b5858aa1b6446955d5318efe0526b.zip
gdb-3e3c397d773b5858aa1b6446955d5318efe0526b.tar.gz
gdb-3e3c397d773b5858aa1b6446955d5318efe0526b.tar.bz2
bfd/
* oasys.c (oasys_write_header): Fix compilation warning on zero-sized memset.
Diffstat (limited to 'bfd/oasys.c')
-rw-r--r--bfd/oasys.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bfd/oasys.c b/bfd/oasys.c
index 11d2440..ebb12e8 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;