fix cx_tree_search() not remembering root as a valid candidate feature/tree_add

Tue, 20 Aug 2024 13:36:56 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 20 Aug 2024 13:36:56 +0200
branch
feature/tree_add
changeset 869
9e7f0db6a725
parent 868
56a908924510
child 870
af0092d8789a

fix cx_tree_search() not remembering root as a valid candidate

src/tree.c file | annotate | diff | comparison | revisions
--- a/src/tree.c	Tue Aug 20 12:39:35 2024 +0200
+++ b/src/tree.c	Tue Aug 20 13:36:56 2024 +0200
@@ -169,8 +169,8 @@
 
     // remember a candidate for adding the data
     // also remember the exact return code from sfunc
-    void *candidate = NULL;
-    int ret_candidate = -1;
+    void *candidate = (void *) root;
+    int ret_candidate = ret;
 
     // process the working stack
     while (work_size > 0) {

mercurial