summaryrefslogtreecommitdiff
path: root/gnu/usr.bin
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>1999-11-08 21:58:00 +0000
committerlukem <lukem@NetBSD.org>1999-11-08 21:58:00 +0000
commitfea5b77bc6f73efdaccc4e4c346006c833317ad2 (patch)
treed77c29a0ccc8e8b62bcd2af358d62fb8a0c5cf9d /gnu/usr.bin
parent1b686307cb2833aaaf07c3adc70aa2d0dac57d44 (diff)
don't bother calling fwrite() if count == 0' ld.c
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r--gnu/usr.bin/ld/ld/ld.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gnu/usr.bin/ld/ld/ld.c b/gnu/usr.bin/ld/ld/ld.c
index 72f4f4bd4e7..29fbaf84ea8 100644
--- a/gnu/usr.bin/ld/ld/ld.c
+++ b/gnu/usr.bin/ld/ld/ld.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ld.c,v 1.65 1999/06/25 12:10:42 pk Exp $ */
+/* $NetBSD: ld.c,v 1.66 1999/11/08 21:58:00 lukem Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -88,7 +88,7 @@
#ifndef lint
/* from: "@(#)ld.c 6.10 (Berkeley) 5/22/91"; */
-__RCSID("$NetBSD: ld.c,v 1.65 1999/06/25 12:10:42 pk Exp $");
+__RCSID("$NetBSD: ld.c,v 1.66 1999/11/08 21:58:00 lukem Exp $");
#endif /* not lint */
#define GNU_BINUTIL_COMPAT /* forwards compatiblity with binutils 2.x */
@@ -4049,6 +4049,8 @@ mywrite(buf, count, eltsize, fd)
FILE *fd;
{
+ if (count == 0)
+ return;
if (fwrite(buf, eltsize, count, fd) != count)
err(1, "write");
}