Index: bfd/oasys.c |
diff --git a/bfd/oasys.c b/bfd/oasys.c |
index 11d24401fe188b2874dd25298d47865887c0521a..ebb12e844e24ca5a7ffa0c35f7370ebf7385855f 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; |