summaryrefslogtreecommitdiff
path: root/src/blocks.c
diff options
context:
space:
mode:
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);