cmark

My personal build of CMark ✏️

Commit
67ad9d17dfbe26e3ac526715d283e2667f28998c
Parent
cc2effd9aca0eb3cc78810d10b99d3d7b7424ad9
Author
John MacFarlane <jgm@berkeley.edu>
Date

Added assertion to peek_char to catch any stray NULLs.

Note that our current procedure for removing nulls is not working properly.

Diffstat

1 file changed, 3 insertions, 0 deletions

Status File Name N° Changes Insertions Deletions
Modified src/inlines.c 3 3 0
diff --git a/src/inlines.c b/src/inlines.c
@@ -178,6 +178,9 @@ static inline int isbacktick(int c)
 
 static inline unsigned char peek_char(subject *subj)
 {
+	// NULL bytes should have been stripped out by now.  If they're
+	// present, it's a programming error:
+	assert(!(subj->pos < subj->input.len && subj->input.data[subj->pos] == 0));
 	return (subj->pos < subj->input.len) ? subj->input.data[subj->pos] : 0;
 }