if bfd_write is invoked with ptr == NULL and (size * nitems) == 0, don't bother calling fwrite(); just return (0)
This commit is contained in:
parent
0f075b205f
commit
8b94063948
2
gnu/dist/bfd/libbfd.c
vendored
2
gnu/dist/bfd/libbfd.c
vendored
@ -526,6 +526,8 @@ bfd_write (ptr, size, nitems, abfd)
|
||||
if ((abfd->flags & BFD_IN_MEMORY) != 0)
|
||||
abort ();
|
||||
|
||||
if (ptr == 0 && size * nitems == 0)
|
||||
return (0);
|
||||
nwrote = fwrite (ptr, 1, (size_t) (size * nitems),
|
||||
bfd_cache_lookup (abfd));
|
||||
if (nwrote > 0)
|
||||
|
Loading…
Reference in New Issue
Block a user