summaryrefslogtreecommitdiff
path: root/src/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/parser.c b/src/parser.c
index ed3c019..0b5b543 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -172,12 +172,14 @@ yaml_parser_parse(yaml_parser_t *parser, yaml_event_t *event)
assert(parser); /* Non-NULL parser object is expected. */
assert(event); /* Non-NULL event object is expected. */
+ /* Erase the event object. */
+
+ memset(event, 0, sizeof(yaml_event_t));
+
/* No events after the end of the stream or error. */
if (parser->stream_end_produced || parser->error ||
parser->state == YAML_PARSE_END_STATE) {
- memset(event, 0, sizeof(yaml_event_t));
-
return 1;
}
@@ -1318,6 +1320,10 @@ error:
return 0;
}
+/*
+ * Append a tag directive to the directives stack.
+ */
+
static int
yaml_parser_append_tag_directive(yaml_parser_t *parser,
yaml_tag_directive_t value, int allow_duplicates, yaml_mark_t mark)