avl_strcmp is now part of libubox
[project/netifd.git] / utils.c
diff --git a/utils.c b/utils.c
index f1143c5..0894c65 100644 (file)
--- a/utils.c
+++ b/utils.c
 #include <stdlib.h>
 #include "utils.h"
 
-int
-avl_strcmp(const void *k1, const void *k2, void *ptr)
-{
-       return strcmp(k1, k2);
-}
-
 void
 vlist_init(struct vlist_tree *tree, avl_tree_comp cmp, vlist_update_cb update)
 {
@@ -123,10 +117,12 @@ vlist_simple_replace(struct vlist_simple_tree *dest, struct vlist_simple_tree *o
 {
        struct vlist_simple_node *n, *tmp;
 
+       vlist_simple_update(dest);
        list_for_each_entry_safe(n, tmp, &old->list, list) {
                list_del(&n->list);
                vlist_simple_add(dest, n);
        }
+       vlist_simple_flush(dest);
 }
 
 void