summaryrefslogtreecommitdiff
path: root/lib/libc/stdio
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2014-12-10 08:24:02 +0000
committerXin LI <delphij@FreeBSD.org>2014-12-10 08:24:02 +0000
commit48c42f48250ee5ecd7bcbc08fdaed08a7cdc76b5 (patch)
treecaa79db0b945f59dd3856d9368db5b3d72841769 /lib/libc/stdio
parentc95e0933c40bd92ad61dbf5666b7ae9e099e5910 (diff)
Notes
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r--lib/libc/stdio/fflush.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libc/stdio/fflush.c b/lib/libc/stdio/fflush.c
index ef9b45b8b6f1..123167a09129 100644
--- a/lib/libc/stdio/fflush.c
+++ b/lib/libc/stdio/fflush.c
@@ -124,11 +124,13 @@ __sflush(FILE *fp)
t = _swrite(fp, (char *)p, n);
if (t <= 0) {
/* Reset _p and _w. */
- if (p > fp->_p) /* Some was written. */
+ if (p > fp->_p) {
+ /* Some was written. */
memmove(fp->_p, p, n);
- fp->_p += n;
- if ((fp->_flags & (__SLBF | __SNBF)) == 0)
- fp->_w -= n;
+ fp->_p += n;
+ if ((fp->_flags & (__SLBF | __SNBF)) == 0)
+ fp->_w -= n;
+ }
fp->_flags |= __SERR;
return (EOF);
}