Merge pull request #414 from WhistlingArrow/master

避免elem的next不为空导致的插入一个链表而非结点
This commit is contained in:
wangzheng0822 2019-11-17 09:23:27 +08:00 committed by GitHub
commit 61fa7326af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}