From 252c575a5cd67b2207ef79e6b29d6f4d12f21ada Mon Sep 17 00:00:00 2001 From: Kirill Simonov Date: Mon, 23 Feb 2009 19:59:19 +0000 Subject: Fixed non-ANSI initializations (fixes #115). --- src/api.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/api.c') diff --git a/src/api.c b/src/api.c index 02e7b14..0c4732e 100644 --- a/src/api.c +++ b/src/api.c @@ -1365,7 +1365,8 @@ yaml_document_append_mapping_pair(yaml_document_t *document, struct { yaml_error_type_t error; } context; - yaml_node_pair_t pair = { key, value }; + + yaml_node_pair_t pair; assert(document); /* Non-NULL document is required. */ assert(mapping > 0 @@ -1378,6 +1379,9 @@ yaml_document_append_mapping_pair(yaml_document_t *document, assert(value > 0 && document->nodes.start + value <= document->nodes.top); /* Valid value id is required. */ + pair.key = key; + pair.value = value; + if (!PUSH(&context, document->nodes.start[mapping-1].data.mapping.pairs, pair)) return 0; -- cgit v1.2.1