elf_getaroff currently returns ELF_C_NULL (0) to indicate that an error
occured (ex. the Elf descriptor is not associated with an archive).
However elf_getaroff is intended to return -1 if an error occurs.
eu-ar assumes -1 indicates an error and other libelf implementations
use -1 to indicate an error in elf_getaroff.
Replace ELF_C_NULL with -1 as elf_getaroff's error return value.
Signed-off-by: Aaron Merey <amerey@redhat.com>
{
/* Be gratious, the specs demand it. */
if (elf == NULL || elf->parent == NULL)
- return ELF_C_NULL;
+ return -1;
/* We can be sure the parent is an archive. */
Elf *parent = elf->parent;