From 67ad9d17dfbe26e3ac526715d283e2667f28998c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 17 Jun 2015 10:09:04 -0700 Subject: Added assertion to peek_char to catch any stray NULLs. Note that our current procedure for removing nulls is not working properly. --- src/inlines.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/inlines.c') diff --git a/src/inlines.c b/src/inlines.c index b43f774..19e650c 100644 --- 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; } -- cgit v1.2.3