From 3b915093d8cbc7738b2de59f6ebc38f195131002 Mon Sep 17 00:00:00 2001 From: Luke Heberling Date: Thu, 13 Dec 2007 08:09:16 +0100 Subject: [PATCH] src/utils_avltree.c: Fix avl_get to work as documented. The documentation in the header file for avl_get states that value may be null, but the code in the source file asserts otherwise. This patch changes the code to reflect the documentation. Signed-off-by: Florian Forster --- src/utils_avltree.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/utils_avltree.c b/src/utils_avltree.c index 09cf2e6f..11d3d716 100644 --- a/src/utils_avltree.c +++ b/src/utils_avltree.c @@ -581,13 +581,12 @@ int avl_get (avl_tree_t *t, const void *key, void **value) { avl_node_t *n; - assert (value != NULL); - n = search (t, key); if (n == NULL) return (-1); - *value = n->value; + if (value != NULL) + *value = n->value; return (0); } -- 2.30.2