summaryrefslogtreecommitdiff
path: root/src/chunk.h
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2016-12-09 21:57:12 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2016-12-09 21:57:12 +0100
commit29c46c5aeda66e9c454ac8d802e65692d0bab566 (patch)
tree387e7ce604437b0a91054304852c2279cbe933dd /src/chunk.h
parent5255e2d5717dc7a265ca79404d387ef8abe8c004 (diff)
Correctly initialize chunk in S_process_line (#170)
The `alloc` member wasn't initialized. This also allows to add an assertion in `chunk_rtrim` which doesn't work for alloced chunks.
Diffstat (limited to 'src/chunk.h')
-rw-r--r--src/chunk.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/chunk.h b/src/chunk.h
index 666484c..f198be3 100644
--- a/src/chunk.h
+++ b/src/chunk.h
@@ -37,6 +37,8 @@ static CMARK_INLINE void cmark_chunk_ltrim(cmark_chunk *c) {
}
static CMARK_INLINE void cmark_chunk_rtrim(cmark_chunk *c) {
+ assert(!c->alloc);
+
while (c->len > 0) {
if (!cmark_isspace(c->data[c->len - 1]))
break;