Guest User

Untitled

a guest
Dec 7th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. static void remove_list_element(line **head, const line *l) {
  2. line *pos;
  3. line *prev=NULL;
  4.  
  5. for (pos=*head; pos; pos=pos->next) {
  6. if (pos == l) {
  7. if (*head == pos) {
  8. /* remove head element */
  9. *head=pos->next;
  10. } else {
  11. prev->next=pos->next;
  12. }
  13. if (pos->coords) {
  14. crFree(pos->coords);
  15. }
  16. crFree(pos);
  17. break;
  18. }
  19. prev=pos;
  20. }
  21. }
Add Comment
Please, Sign In to add comment