From 258e987c94f61449e507f24d89613b1d41861487 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 11 Dec 2011 09:57:08 +0000 Subject: Shrink code. git-svn-id: http://svn.drobilla.net/serd/trunk@239 490d8e77-9747-427b-9fa3-0b8f29cee8a0 --- src/reader.c | 7 ++----- 1 file 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 -- cgit v1.2.1