Message ID | 20170707134002.49500-28-luc.vanoostenryck@gmail.com (mailing list archive) |
---|---|
State | Rejected, archived |
Headers | show |
diff --git a/ptrlist.c b/ptrlist.c index cdc4ae4b0..b4fb3fd6e 100644 --- a/ptrlist.c +++ b/ptrlist.c @@ -232,10 +232,13 @@ void * delete_ptr_list_last(struct ptr_list **head) void concat_ptr_list(struct ptr_list *a, struct ptr_list **b) { - void *entry; - FOR_EACH_PTR(a, entry) { - add_ptr_list(b, entry); - } END_FOR_EACH_PTR(entry); + struct ptr_cur cur; + + if (!ptr_cur_beg(&cur, a)) + return; + + while (ptr_cur_next(&cur)) + __add_ptr_list(b, ptr_cur_entry(&cur), 0); } void __free_ptr_list(struct ptr_list **listp)