diff --git a/src/igs.c b/src/igs.c index aa38a69..58ad34b 100644 --- a/src/igs.c +++ b/src/igs.c @@ -658,7 +658,7 @@ void igw_order(inet_gw **igws, int *igws_counter, inet_gw **my_igws, int level) if(!igws_counter[level] || !igws[level]) return; - new_head=clist_qsort(igws[level], igws_counter[level], igw_cmp); + clist_qsort(new_head, igws[level], igws_counter[level], igw_cmp); igw=new_head; list_for(igw) { diff --git a/src/llist.c b/src/llist.c index df92300..a10707c 100644 --- a/src/llist.c +++ b/src/llist.c @@ -606,9 +606,9 @@ do{ \ * should be aware of this. * - it follows the new order of `tmp' and appends each array element in * a new llist. - * - the head of the new llist is returned. + * - the head of the new llist is assigned to _new_head */ -#define clist_qsort(_head, _counter, _cmp_func) \ +#define clist_qsort(_new_head, _head, _counter, _cmp_func) \ ({ \ l_list *_hcq=(l_list *)(_head), *_ncq, *_hecq, *_tcq; \ int _icq=0, _ccq; \ @@ -629,7 +629,7 @@ do{ \ for(_icq=0; _icq<_ccq; _icq++) \ _tcq=(l_list *)list_append(0, _tcq, _tmp_list[_icq]); \ \ - (typeof((_head)))_hecq; \ + _new_head = (typeof((_head)))_hecq; \ }) \ #endif /*LLIST_C*/