Merge pull request #414 from WhistlingArrow/master
避免elem的next不为空导致的插入一个链表而非结点
This commit is contained in:
commit
61fa7326af
@ -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