summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-06-17 10:09:04 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-06-17 12:30:01 -0700
commit67ad9d17dfbe26e3ac526715d283e2667f28998c (patch)
tree6fcca4176000ca64600f4ea46f81f97361e9ead3 /src
parentcc2effd9aca0eb3cc78810d10b99d3d7b7424ad9 (diff)
Added assertion to peek_char to catch any stray NULLs.
Note that our current procedure for removing nulls is not working properly.
Diffstat (limited to 'src')
-rw-r--r--src/inlines.c3
1 files changed, 3 insertions, 0 deletions
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;
}