I would like to insist since I got no answer.
The explanation for the infinite loop is that Of_parent eventually returns -1 in the case that no node with name 'target' is found.
De : yarl-baudig%mailoo.org@localhost
À : Tech Kern <tech-kern%netbsd.org@localhost>
Sujet : of_getnode_byname: infinite loop
Date : 19/04/2019 11:30:41 Europe/Paris
Hello,
of_getnode_byname(start, target) goes on infinite loop if no node with 'target' name exists.
Moreover, I think the function should not go out of the subtree whose 'start' is the root.
Also, both the tests and the documentation can be improved.
I propose the attached patch.
Thank you.