Commit ae4ef0c8 by Rudolf

Fix handling of NULL char

This character is special because we cannot directly address it. We need to make
sure we are at the leaf node before.
parent 3825ab82
Showing with 1 additions and 1 deletions
......@@ -159,7 +159,7 @@ static int get_rev_path(struct tree *parent, unsigned char c, int *buf,
if (parent == NULL)
return -1;
if (parent->ch == c)
if (parent->ch == c && parent->left == NULL && parent->right == NULL)
return index;
if ((ret = get_rev_path(parent->left, c, buf, index)) >= 0)
......
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 sign in to comment