summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1998-02-17 17:29:50 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1998-02-17 17:29:50 +0000
commit6eb78d60c282b83a9dd052fa3b4d0c61d00a09f0 (patch)
tree009ccc097dedb41a317a207fa1f7b9b3bc768577
parente3fb95be71218031e1e70eaf83bea13a79bfd60e (diff)
Notes
-rw-r--r--lib/libc/stdio/fvwrite.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libc/stdio/fvwrite.c b/lib/libc/stdio/fvwrite.c
index 28db2bafc4f65..59559c3995d4c 100644
--- a/lib/libc/stdio/fvwrite.c
+++ b/lib/libc/stdio/fvwrite.c
@@ -39,7 +39,7 @@
static char sccsid[] = "@(#)fvwrite.c 8.1 (Berkeley) 6/4/93";
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: fvwrite.c,v 1.3 1996/06/22 10:33:27 jraynard Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -115,9 +115,11 @@ __sfvwrite(fp, uio)
if (fp->_flags & __SSTR) {
if (len < w)
w = len;
- COPY(w); /* copy MIN(fp->_w,len), */
- fp->_w -= w;
- fp->_p += w;
+ if (w > 0) {
+ COPY(w); /* copy MIN(fp->_w,len), */
+ fp->_w -= w;
+ fp->_p += w;
+ }
w = len; /* but pretend copied all */
} else if (fp->_p > fp->_bf._base && len > w) {
/* fill and flush */