Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void remove_list_element(line **head, const line *l) {
- line *pos;
- line *prev=NULL;
- for (pos=*head; pos; pos=pos->next) {
- if (pos == l) {
- if (*head == pos) {
- /* remove head element */
- *head=pos->next;
- } else {
- prev->next=pos->next;
- }
- if (pos->coords) {
- crFree(pos->coords);
- }
- crFree(pos);
- break;
- }
- prev=pos;
- }
- }
Add Comment
Please, Sign In to add comment