避免elem的next不为空导致的插入一个链表而非结点
This commit is contained in:
parent
e0e4e68e6e
commit
16ed6a71e7
@ -31,8 +31,7 @@ void insert(struct single_list **prev, struct single_list *elem)
|
||||
if (!prev)
|
||||
return;
|
||||
|
||||
if (*prev)
|
||||
elem->next = *prev;
|
||||
elem->next = *prev;
|
||||
*prev = elem;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user