aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-12-11 09:57:08 +0000
committerDavid Robillard <d@drobilla.net>2011-12-11 09:57:08 +0000
commit258e987c94f61449e507f24d89613b1d41861487 (patch)
treeb4b2f84afd45ef6a1d1676a0c13d29d9aa439f76 /src
parent3b35d1347da4e1807e76e5d61eab14be7de28ffd (diff)
downloadserd-258e987c94f61449e507f24d89613b1d41861487.tar.gz
serd-258e987c94f61449e507f24d89613b1d41861487.tar.bz2
serd-258e987c94f61449e507f24d89613b1d41861487.zip
Shrink code.
git-svn-id: http://svn.drobilla.net/serd/trunk@239 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'src')
-rw-r--r--src/reader.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/reader.c b/src/reader.c
index e430a206..d035448e 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -118,14 +118,11 @@ page(SerdReader* reader)
assert(reader->from_file);
reader->read_head = 0;
const size_t n_read = fread(reader->read_buf, 1, READ_BUF_LEN, 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 < READ_BUF_LEN) {
- reader->read_buf[n_read] = '\0';
}
- return true;
+ return !reader->eof;
}
static inline bool