diff --git a/bp_tree.c b/bp_tree.c index fb05384e587ead33dec7f3dd58099e7b62315428..73d57755ea3719c89f6fe49f0a18f2a7387100c7 100644 --- a/bp_tree.c +++ b/bp_tree.c @@ -78,10 +78,10 @@ control bp_insert_into(node *nd, control val) } nd->count++; - control v; - v.value = 0; + if (nd->count == M) { + control v; node *new = bp_split(nd); v.lhs = nd; v.rhs = new; @@ -90,7 +90,7 @@ control bp_insert_into(node *nd, control val) nd->next = new; return v; } - return v; + return CONST_CONTR; } control bp_insert(node *nd, control val){ @@ -261,4 +261,4 @@ void bp_print(node *nd, int depth) return bp_print(nd->childs[i+1], depth + 1); } } -} \ No newline at end of file +}