Skip to content

Commit e70ea33

Browse files
author
xtaci
committed
fix a bound error in dos_tree
1 parent 265328d commit e70ea33

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

include/dos_tree.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,10 @@ namespace alg
197197
void fixup_size(rbtree_node n)
198198
{
199199
// fix up to the root
200-
n = n->parent;
201-
while(n != NULL) {
200+
do {
202201
DOSNODE(n)->size -= 1;
203202
n = n->parent;
204-
}
203+
} while(n != NULL);
205204
}
206205

207206
static inline dostree_node

0 commit comments

Comments
 (0)