projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
65cbd6c
)
src/utils_avltree.c: Fix avl_get to work as documented.
author
Luke Heberling
<collectd@c-ware.com>
Thu, 13 Dec 2007 07:09:16 +0000
(08:09 +0100)
committer
Florian Forster
<octo@huhu.verplant.org>
Thu, 13 Dec 2007 07:09:16 +0000
(08:09 +0100)
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 <octo@huhu.verplant.org>
src/utils_avltree.c
patch
|
blob
|
history
diff --git
a/src/utils_avltree.c
b/src/utils_avltree.c
index
09cf2e6
..
11d3d71
100644
(file)
--- 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);
}