aboutsummaryrefslogtreecommitdiff
path: root/src/lib/libc/stdio.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2017-05-08 16:43:31 +0200
committerAlex Auvolat <alex@adnab.me>2017-05-08 16:43:31 +0200
commit287a579f65e6e5e3c4610cbf134123691ee3e64c (patch)
tree1774e1ec804fa712d3d87547ef5c7e45998b2f12 /src/lib/libc/stdio.c
parente72e5e87497744410fb62843ef852d26bf5277d2 (diff)
downloadkogata-287a579f65e6e5e3c4610cbf134123691ee3e64c.tar.gz
kogata-287a579f65e6e5e3c4610cbf134123691ee3e64c.zip
Implement tk.box
Diffstat (limited to 'src/lib/libc/stdio.c')
-rw-r--r--src/lib/libc/stdio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/libc/stdio.c b/src/lib/libc/stdio.c
index bfa2f74..df30e08 100644
--- a/src/lib/libc/stdio.c
+++ b/src/lib/libc/stdio.c
@@ -215,7 +215,7 @@ size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream) {
stream->pos += ret;
}
- if (ret < size * nmemb) {
+ if (ret < size * nmemb || stream->pos >= stream->st.size) {
stream->flags |= STDIO_FL_EOF;
}