aboutsummaryrefslogtreecommitdiff
path: root/libio/iofwrite.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/iofwrite.c')
-rw-r--r--libio/iofwrite.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libio/iofwrite.c b/libio/iofwrite.c
index 0f82797..d163d29 100644
--- a/libio/iofwrite.c
+++ b/libio/iofwrite.c
@@ -35,15 +35,15 @@ _IO_fwrite (buf, size, count, fp)
_IO_size_t request = size * count;
_IO_size_t written;
CHECK_FILE (fp, 0);
+ /* Many traditional implementations return 0 if size==0 && count > 0,
+ but ANSI requires us to return count in this case. */
if (request == 0)
- return 0;
+ return count;
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
_IO_flockfile (fp);
written = _IO_sputn (fp, (const char *) buf, request);
_IO_funlockfile (fp);
_IO_cleanup_region_end (0);
- /* Many traditional implementations return 0 if size==0 && count > 0,
- but ANSI requires us to return count in this case. */
if (written == request)
return count;
else