summaryrefslogtreecommitdiff
path: root/server/util/btreemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'server/util/btreemap.c')
-rw-r--r--server/util/btreemap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/util/btreemap.c b/server/util/btreemap.c
index 2d9b1761..9bfc9855 100644
--- a/server/util/btreemap.c
+++ b/server/util/btreemap.c
@@ -65,7 +65,7 @@ int btreemap_search_key(struct btreemap *map, const void *key, struct btreemap *
tempnode = map;
while (found == BTREEMAP_EMPTY) {
- result = tempnode->comparator(tempnode->key, key);
+ result = tempnode->comparator(key, tempnode->key);
if (result > 0)
{
if (tempnode->right)
@@ -150,6 +150,8 @@ int btreemap_set_value(TALLOC_CTX *mem_ctx,
new_node->key = talloc_steal(new_node, key);
new_node->value = talloc_steal(new_node, value);
new_node->comparator = comparator;
+ new_node->left = NULL;
+ new_node->right = NULL;
if (found == BTREEMAP_EMPTY)