diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2014-11-23 14:00:00 +0100 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2014-11-23 14:00:00 +0100 |
commit | f2e6aaf9b9c3a5108b1d89d6c70a6ae93cecf690 (patch) | |
tree | 5bb69d58c93d70e46c4262a1be7e7beb60f048f1 /src | |
parent | 4570eb2bff2e1b71fa5b6408abbc69c98ff5ff24 (diff) |
Fix segfault on docs without trailing newline
Diffstat (limited to 'src')
-rw-r--r-- | src/blocks.c | 2 |
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++; |