Does nobody know how to write a linked list properly? I mean seriously!
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@17183 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
6fa10d3955
commit
1ad6e500c4
|
@ -478,11 +478,13 @@ struct { \
|
|||
(head)->last = NULL; \
|
||||
} else { \
|
||||
typeof(elm) curelm = (head)->first; \
|
||||
while (curelm->field.next != (elm)) \
|
||||
while (curelm && (curelm->field.next != (elm))) \
|
||||
curelm = curelm->field.next; \
|
||||
curelm->field.next = (elm)->field.next; \
|
||||
if ((head)->last == (elm)) \
|
||||
(head)->last = curelm; \
|
||||
if (curelm) { \
|
||||
curelm->field.next = (elm)->field.next; \
|
||||
if ((head)->last == (elm)) \
|
||||
(head)->last = curelm; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
|
Reference in New Issue