aboutsummaryrefslogtreecommitdiff
path: root/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'tree.c')
-rw-r--r--tree.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tree.c b/tree.c
index f8277cd..94355dc 100644
--- a/tree.c
+++ b/tree.c
@@ -62,10 +62,9 @@ tree_insert(struct tree_node *tree, T key)
62struct tree_node * 62struct tree_node *
63tree_insert_it(struct tree_node *root, T key) 63tree_insert_it(struct tree_node *root, T key)
64{ 64{
65 struct tree_node *parent = NULL, 65 struct tree_node *parent = NULL;
66 *curr = root;
67 66
68 while ( curr != NULL ) { 67 for ( struct tree_node *curr = root; curr != NULL; ) {
69 parent = curr; 68 parent = curr;
70 69
71 if ( key < curr->key ) { 70 if ( key < curr->key ) {