summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/fflush.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdio/fflush.c')
-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 ef9b45b..123167a 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);
}
OpenPOWER on IntegriCloud