Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/bfd if bfd_write is invoked with ptr == NULL and (s...



details:   https://anonhg.NetBSD.org/src/rev/1412a275b5f7
branches:  trunk
changeset: 476480:1412a275b5f7
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Sep 17 13:38:19 1999 +0000

description:
if bfd_write is invoked with ptr == NULL and (size * nitems) == 0, don't bother calling fwrite(); just return (0)

diffstat:

 gnu/dist/bfd/libbfd.c |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (12 lines):

diff -r 5e64ac823522 -r 1412a275b5f7 gnu/dist/bfd/libbfd.c
--- a/gnu/dist/bfd/libbfd.c     Fri Sep 17 13:13:32 1999 +0000
+++ b/gnu/dist/bfd/libbfd.c     Fri Sep 17 13:38:19 1999 +0000
@@ -526,6 +526,8 @@
   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)



Home | Main Index | Thread Index | Old Index