X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftlist%2Ftlist.h;h=937a834c0184fb4d54928ca57db9668a929b1f8c;hp=1ce0b85ed9f03c01333c8412c2d260541f8724cb;hb=919b97d6e573eb794d7819f1af8da29023d6b193;hpb=a6b5111fe6948e51114c33aa34785c9fd0d403e6 diff --git a/ccan/tlist/tlist.h b/ccan/tlist/tlist.h index 1ce0b85e..937a834c 100644 --- a/ccan/tlist/tlist.h +++ b/ccan/tlist/tlist.h @@ -185,6 +185,8 @@ * Example: * struct child *first; * first = tlist_top(&parent->children, list); + * if (!first) + * printf("Empty list!\n"); */ #define tlist_top(h, member) \ ((tcon_type((h), canary)) \ @@ -202,6 +204,8 @@ * Example: * struct child *last; * last = tlist_tail(&parent->children, list); + * if (!last) + * printf("Empty list!\n"); */ #define tlist_tail(h, member) \ ((tcon_type((h), canary)) \