Commit 0720b667 authored by Leah Neukirchen's avatar Leah Neukirchen

fitree_walk: don't crash on empty tree

parent 1a50278a
......@@ -1535,6 +1535,8 @@ fitree_insert(struct fitree *node, struct fileinfo *fi)
void
fitree_walk(struct fitree *node, void (*visit)(struct fileinfo *))
{
if (!node)
return;
if (node->left != &fitree_sentinel)
fitree_walk(node->left, visit);
visit(node->fi);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment