strcat (fullpath, filename);
/* Convert any UNIX style path separators into the DOS form. */
- for (i = 0, fullpath[i]; i++)
+ for (i = 0; fullpath[i]; i++)
{
if (IS_UNIX_DIR_SEPARATOR (fullpath[i]))
fullpath[i] = '\\';
struct areltdata *adata = (struct areltdata *) abfd->arelt_data;
archive_size = adata->parsed_size;
/* If the archive is compressed we can't compare against file size. */
- if (memcmp (((struct ar_hdr *) adata->arch_header)->ar_fmag,
- "Z\012", 2) == 0)
+ if (adata->arch_header != NULL
+ && memcmp (((struct ar_hdr *) adata->arch_header)->ar_fmag,
+ "Z\012", 2) == 0)
return archive_size;
abfd = abfd->my_archive;
}
{
struct bfd_in_memory *bim = (struct bfd_in_memory *) abfd->iostream;
- if (bim->buffer != NULL)
- free (bim->buffer);
+ free (bim->buffer);
free (bim);
abfd->iostream = NULL;