diff options
Diffstat (limited to 'src/stdio/fflush.c')
-rw-r--r-- | src/stdio/fflush.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/stdio/fflush.c b/src/stdio/fflush.c index 2250aaaf..a1e984f9 100644 --- a/src/stdio/fflush.c +++ b/src/stdio/fflush.c @@ -13,7 +13,10 @@ int fflush(FILE *stream) if (stream == NULL) { size_t i; for (i = 0; i < FOPEN_MAX; i++) { - fflush(&(__stdio.FILES[i])); + stream = __stdio.FILES + i; + if (stream->write && (stream->operation != OP_INPUT)) { + fflush(stream); + } } return 0; } |