cmark

My personal build of CMark ✏️

Commit
d381716785d826084432eeb38b91be2fbbbfc081
Parent
80e5cf9c4af65ac627f3c612181d741babc85b1b
Author
John MacFarlane <jgm@berkeley.edu>
Date

Initialize all fields in node when creating inlines.

Diffstat

1 file changed, 22 insertions, 0 deletions

Status File Name N° Changes Insertions Deletions
Modified src/inlines.c 22 22 0
diff --git 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;
 }