lists issue

Maria Jan Matějka jan.matejka at nic.cz
Fri Jul 27 21:43:46 CEST 2018


Hello!

See the init_list() function and the list structure. All lists in lib/lists.[hc] have heads. Therefore if n->prev is NULL, you don't have a valid node but a list head, the same for list tail and n->next. 

All valid nodes have valid both prev and next pointers.

Maria 

On July 27, 2018 8:53:18 AM GMT+02:00, Arvin Gan <AGan at advaoptical.com> wrote:
>Hi all,
>There may be an issue  in blow function when deleted the node is the
>first one, that mean n->prev is NULL....., similarly, same issue as the
>last one node is deleted.
>
>LIST_INLINE void
>rem_node(node *n)
>{
>  node *z = n->prev;
>  node *x = n->next;
>
>   z->next = x;
>   x->prev = z;
>   n->next = NULL;
>   n->prev = NULL;
>}
>
>Thanks
>Arvin

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20180727/deea863a/attachment.html>


More information about the Bird-users mailing list