summaryrefslogtreecommitdiff
path: root/src/blocks.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-12-02 16:20:58 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-12-02 16:20:58 -0800
commit366af1187ad409b2fca12cd7a2b939019727db7d (patch)
treeb80d1b2a9edbcf1aa12ada60d76801835efbb607 /src/blocks.c
parent4cf29883ef1307de329bf381d53e9aeb8e1f65a7 (diff)
parent7f5ee96078ac6f283767d2b582ea334fe9c18ff4 (diff)
Merge pull request #232 from nwellnhof/eof_detection
Fix EOF detection
Diffstat (limited to 'src/blocks.c')
-rw-r--r--src/blocks.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/blocks.c b/src/blocks.c
index 5d11710..4a0a228 100644
--- a/src/blocks.c
+++ b/src/blocks.c
@@ -435,6 +435,9 @@ cmark_node *cmark_parse_file(FILE *f)
while ((bytes = fread(buffer, 1, sizeof(buffer), f)) > 0) {
bool eof = bytes < sizeof(buffer);
S_parser_feed(parser, buffer, bytes, eof);
+ if (eof) {
+ break;
+ }
}
document = cmark_parser_finish(parser);