From d381716785d826084432eeb38b91be2fbbbfc081 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 18 Nov 2014 09:27:40 -0800 Subject: Initialize all fields in node when creating inlines. --- src/inlines.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/inlines.c') diff --git a/src/inlines.c b/src/inlines.c index 6c90116..37ad768 100644 --- a/src/inlines.c +++ b/src/inlines.c @@ -90,6 +90,12 @@ static inline cmark_node* make_inlines(cmark_node_type t, cmark_node* contents) e->type = t; e->first_child = contents; e->next = NULL; + e->prev = NULL; + e->parent = NULL; + // These fields aren't used for inlines: + e->start_line = 0; + e->start_column = 0; + e->end_line = 0; } return e; } @@ -102,6 +108,14 @@ static inline cmark_node* make_literal(cmark_node_type t, cmark_chunk s) e->type = t; e->as.literal = s; e->next = NULL; + e->prev = NULL; + e->parent = NULL; + e->first_child = NULL; + e->last_child = NULL; + // These fields aren't used for inlines: + e->start_line = 0; + e->start_column = 0; + e->end_line = 0; } return e; } @@ -113,6 +127,14 @@ static inline cmark_node* make_simple(cmark_node_type t) if(e != NULL) { e->type = t; e->next = NULL; + e->prev = NULL; + e->parent = NULL; + e->first_child = NULL; + e->last_child = NULL; + // These fields aren't used for inlines: + e->start_line = 0; + e->start_column = 0; + e->end_line = 0; } return e; } -- cgit v1.2.3