From 0ae85f6545b1d4a64836b0a3a5676a0bed9854d5 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Sat, 24 Jun 2017 11:45:40 +0200 Subject: utils: trie: fixed bug in foreach implementation. when looping through the tree, the algorithm would stop, if found a '\0' in the key of the tree node. there should be no "child" field after a '\0', but "next" fields may exist. --- src/common/utils.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/common/utils.c b/src/common/utils.c index 1ed79bf..97fa671 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -615,10 +615,8 @@ bc_trie_foreach_node(bc_trie_node_t *node, bc_string_t *str, if (node == NULL || str == NULL || func == NULL) return; - if (node->key == '\0') { + if (node->key == '\0') func(str->str, node->data, user_data); - return; - } if (node->child != NULL) { bc_string_t *child = bc_string_dup(str); -- cgit v1.2.3-18-g5258