Parcourir la source

core: clist - restet prev/next when removing from clist slot

Daniel-Constantin Mierla il y a 10 ans
Parent
commit
0fbcca3857
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      clist.h

+ 3 - 1
clist.h

@@ -87,7 +87,9 @@
 #define clist_rm_sublist(s, e, next, prev) \
 	do{\
 		(s)->prev->next=(e)->next;  \
-		(e)->next->prev=(s)->prev ; \
+		(e)->next->prev=(s)->prev;  \
+		(s)->prev=NULL; \
+		(e)->next=NULL; \
 	}while(0)