]> git.ozlabs.org Git - ccan/blobdiff - ccan/tal/str/test/helper.h
tal: make tal_next() only return immediate children.
[ccan] / ccan / tal / str / test / helper.h
index c1bc9ccf70ee0a7c101f8e5f6a97964e3c7a1b3f..5f0b68f5dca769ad33c03c6e2c6c6bde2ba2c3f5 100644 (file)
@@ -17,6 +17,6 @@ static inline bool no_children(const void *ctx)
 
 static inline bool single_child(const void *ctx, const void *child)
 {
-       return tal_first(ctx) == child && !tal_next(ctx, child);
+       return tal_first(ctx) == child && !tal_next(child) && !tal_first(child);
 }
 #endif