Browse Source

Fixed debug print

tree_alloc
Thomas Johnson 1 year ago
parent
commit
8ca9ddcdd7
  1. 5
      tree_alloc.c

5
tree_alloc.c

@ -23,10 +23,11 @@ void debug_print_tree(int indent, void *p) {
node->parent->color == COLOR_RED));
debug_print_tree(indent + 1, node->left);
for (int ii = 0; ii < indent; ii++) { printf(" "); }
if (node->color == COLOR_RED) { printf(bad ? "\e[30m]" : "\e[31m"); }
if (node->color == COLOR_RED) { printf("\e[31m"); }
else if (bad) { printf("\e[30m]"); }
if (bad) { printf("\e[43m"); }
printf("%p %lu\n", node, node->size);
if (node->color == COLOR_RED) { printf("\e[37m"); }
printf("\e[37m");
if (bad) { printf("\e[40m"); }
debug_print_tree(indent + 1, node->right);
}

Loading…
Cancel
Save