diff options
| author | Ulrich Drepper <[email protected]> | 2007-10-16 05:21:27 +0000 |
|---|---|---|
| committer | Ulrich Drepper <[email protected]> | 2007-10-16 05:21:27 +0000 |
| commit | b597dfad924980dede10d7c19d87900b6172e599 (patch) | |
| tree | 3c090b69070ad0056d479d90aa1f8829810140ba /libelf/elf_begin.c | |
| parent | 3fc3d7bd6bd8485404a936f7354e781dc2be6a5a (diff) | |
merge of '92c36bfdbc6468d1711c043b530e0dfe5abb6dec'
and 'c22c8c43f8f68b0bffd4d5ccdb2282c958268742'
Diffstat (limited to 'libelf/elf_begin.c')
| -rw-r--r-- | libelf/elf_begin.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libelf/elf_begin.c b/libelf/elf_begin.c index b68410be..13f965f7 100644 --- a/libelf/elf_begin.c +++ b/libelf/elf_begin.c @@ -812,7 +812,14 @@ __libelf_next_arhdr (elf) if (endp != NULL) endp[-1] = '\0'; else - elf->state.ar.raw_name[16] = '\0'; + { + /* In the old BSD style of archive, there is no / terminator. + Instead, there is space padding at the end of the name. */ + size_t i = 15; + do + elf->state.ar.ar_name[i] = '\0'; + while (i > 0 && elf->state.ar.ar_name[--i] == ' '); + } elf_ar_hdr->ar_name = elf->state.ar.ar_name; } |
