OSDN Git Service
(root)
/
uclinux-h8
/
uClibc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4e88ea4
)
Fix fwrite return value bug reported by Matthias Kilian <kili@outback.escape.de>.
author
Manuel Novoa III
<mjn3@codepoet.org>
Mon, 7 May 2001 20:17:35 +0000
(20:17 -0000)
committer
Manuel Novoa III
<mjn3@codepoet.org>
Mon, 7 May 2001 20:17:35 +0000
(20:17 -0000)
libc/stdio/stdio.c
patch
|
blob
|
history
diff --git
a/libc/stdio/stdio.c
b/libc/stdio/stdio.c
index
a7dd8a3
..
d3732db
100644
(file)
--- a/
libc/stdio/stdio.c
+++ b/
libc/stdio/stdio.c
@@
-512,12
+512,13
@@
off_t _uClibc_fwrite(const unsigned char *buf, off_t bytes, FILE *fp)
}
FFLUSH:
/* If we get here, either buffer is full or we need to flush anyway. */
+ buf = fp->bufpos - (p - (unsigned char *)buf);
p = NULL;
}
if (!p) { /* buf == NULL means fflush */
p = fp->bufstart;
bytes = fp->bufpos - p;
-
buf =
fp->bufpos = fp->bufwrite = p;
+ fp->bufpos = fp->bufwrite = p;
} else if (fp->bufpos > fp->bufstart) { /* If there are buffered chars, */
_uClibc_fwrite(NULL, 0, fp); /* write them. */
if (ferror(fp)) {