From caa451f0245e8b5753c0e90792f088e26b5edc7b Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Sat, 17 Feb 2024 03:04:47 -0500 Subject: [PATCH] fix: don't log NUL characters Graphviz dot will fail with this character present --- lib/src/subtree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/subtree.c b/lib/src/subtree.c index cad48df4..065b3a32 100644 --- a/lib/src/subtree.c +++ b/lib/src/subtree.c @@ -997,7 +997,7 @@ void ts_subtree__print_dot_graph(const Subtree *self, uint32_t start_offset, ts_subtree_lookahead_bytes(*self) ); - if (ts_subtree_is_error(*self) && ts_subtree_child_count(*self) == 0) { + if (ts_subtree_is_error(*self) && ts_subtree_child_count(*self) == 0 && self->ptr->lookahead_char != 0) { fprintf(f, "\ncharacter: '%c'", self->ptr->lookahead_char); }