diff options
author | David Robillard <d@drobilla.net> | 2017-04-24 22:33:23 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-04-24 22:33:23 +0200 |
commit | 221549c2580bb72ceb91cfff70e7295f65ce46bf (patch) | |
tree | bce03a6583b9fe053f54f9af3526d8e298fd8b02 | |
parent | 52d36530ef5bfd1b2be810a1ade6e034b76aa097 (diff) | |
download | serd-221549c2580bb72ceb91cfff70e7295f65ce46bf.tar.gz serd-221549c2580bb72ceb91cfff70e7295f65ce46bf.tar.bz2 serd-221549c2580bb72ceb91cfff70e7295f65ce46bf.zip |
Fix reading with non-standard page sizes
-rw-r--r-- | src/byte_source.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/byte_source.c b/src/byte_source.c index aeff11df..af73fbfe 100644 --- a/src/byte_source.c +++ b/src/byte_source.c @@ -21,12 +21,12 @@ serd_byte_source_page(SerdByteSource* source) { source->read_head = 0; size_t n_read = source->read_func( - source->file_buf, 1, SERD_PAGE_SIZE, source->stream); + source->file_buf, 1, source->page_size, source->stream); if (n_read == 0) { source->file_buf[0] = '\0'; return (source->error_func(source->stream) ? SERD_ERR_UNKNOWN : SERD_FAILURE); - } else if (n_read < SERD_PAGE_SIZE) { + } else if (n_read < source->page_size) { source->file_buf[n_read] = '\0'; } return SERD_SUCCESS; |