summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTina Müller <cpan2@tinita.de>2019-02-28 19:40:53 +0100
committerTina Müller <cpan2@tinita.de>2019-02-28 19:40:53 +0100
commit1560fc82ad6f642553edacae9d99f192ed480221 (patch)
treec3f5ff814336f8b1dbabd27119ec5201a12887dd
parent85d1f168ef39f4c4419ef362d849ea225c53fffc (diff)
downloadlibyaml-git-1560fc82ad6f642553edacae9d99f192ed480221.tar.gz
Make declarations before other statements
-rw-r--r--tests/run-dumper.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/run-dumper.c b/tests/run-dumper.c
index 302b9b9..04c5bee 100644
--- a/tests/run-dumper.c
+++ b/tests/run-dumper.c
@@ -79,10 +79,12 @@ error:
int compare_nodes(yaml_document_t *document1, int index1,
yaml_document_t *document2, int index2, int level)
{
- if (level++ > 1000) return 0;
- yaml_node_t *node1 = yaml_document_get_node(document1, index1);
- yaml_node_t *node2 = yaml_document_get_node(document2, index2);
int k;
+ yaml_node_t *node1;
+ yaml_node_t *node2;
+ if (level++ > 1000) return 0;
+ node1 = yaml_document_get_node(document1, index1);
+ node2 = yaml_document_get_node(document2, index2);
assert(node1);
assert(node2);