submit3
This commit is contained in:
parent
fddead63be
commit
f7ca4276c3
@ -15,7 +15,9 @@ struct snake* remove_snake(struct snake* snake){
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
struct snake* curent_element = snake;
|
struct snake* curent_element = snake;
|
||||||
|
struct snake* previous_element;
|
||||||
while(curent_element->next != NULL){
|
while(curent_element->next != NULL){
|
||||||
|
previous_element=curent_element;
|
||||||
curent_element = curent_element->next;
|
curent_element = curent_element->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,6 +27,8 @@ struct snake* remove_snake(struct snake* snake){
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
previous_element->next=NULL;
|
||||||
|
|
||||||
return snake;
|
return snake;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user