aboutsummaryrefslogtreecommitdiffstats
path: root/src/reader.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/reader.c')
-rw-r--r--src/reader.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/reader.c b/src/reader.c
index da70e6db..c1c2a1bd 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -115,11 +115,14 @@ page(SerdReader* reader)
assert(reader->from_file);
reader->read_head = 0;
const size_t n_read = fread(reader->read_buf, 1, SERD_PAGE_SIZE, reader->fd);
- reader->read_buf[n_read] = '\0';
if (n_read == 0) {
+ reader->read_buf[0] = '\0';
reader->eof = true;
+ return false;
+ } else if (n_read < SERD_PAGE_SIZE) {
+ reader->read_buf[n_read] = '\0';
}
- return !reader->eof;
+ return true;
}
static inline bool