aboutsummaryrefslogtreecommitdiff
path: root/src/blocks.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/blocks.c')
-rw-r--r--src/blocks.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/blocks.c b/src/blocks.c
index 2a6cdd8..c74b425 100644
--- a/src/blocks.c
+++ b/src/blocks.c
@@ -441,7 +441,7 @@ extern cmark_node *cmark_parse_document(const char *buffer, size_t len)
while (buffer < end) {
const char *eol = memchr(buffer, '\n', end - buffer);
- offset = eol ? (eol - buffer) + 1 : eol - buffer;
+ offset = eol ? (eol - buffer) + 1 : end - buffer;
cmark_process_line(parser, buffer, offset);
buffer += offset;
linenum++;