From 202a6ff614acead5378d89c66e1d83f77f487739 Mon Sep 17 00:00:00 2001 From: John Sanpe Date: Tue, 4 Feb 2025 00:51:27 +0800 Subject: [PATCH] feat radix: when tree is empty first/last will get offset 0 Signed-off-by: John Sanpe --- src/radix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/radix.c b/src/radix.c index 3f8fe633..f473a77e 100644 --- a/src/radix.c +++ b/src/radix.c @@ -327,6 +327,7 @@ bfdev_radix_root_first(bfdev_radix_root_t *root, uintptr_t *offsetp) bfdev_radix_node_t *node; uintptr_t offset; + *offsetp = 0; node = root->node; level = root->level; @@ -354,6 +355,7 @@ bfdev_radix_root_last(bfdev_radix_root_t *root, uintptr_t *offsetp) bfdev_radix_node_t *node; uintptr_t offset; + *offsetp = 0; node = root->node; level = root->level;