summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4d37668)
raw | patch | inline | side by side (parent: 4d37668)
author | Florian Forster <octo@collectd.org> | |
Mon, 8 Oct 2012 14:20:34 +0000 (16:20 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Mon, 8 Oct 2012 14:20:34 +0000 (16:20 +0200) |
When inserting the first node in the tree, the size is not incremented.
This causes c_avl_size() to return one element too little.
Thanks to Yves Mettier for debugging this!
This causes c_avl_size() to return one element too little.
Thanks to Yves Mettier for debugging this!
src/utils_avltree.c | patch | blob | history |
diff --git a/src/utils_avltree.c b/src/utils_avltree.c
index ba7cd95fde9f81cc1e68f0dc34fb6ec8f57ff3ad..f71b1fd6913bbc9676bb0e494d26bba1f829e7c2 100644 (file)
--- a/src/utils_avltree.c
+++ b/src/utils_avltree.c
{
new->parent = NULL;
t->root = new;
+ t->size = 1;
return (0);
}