Initialization
This commit is contained in:
parent
f34a09b2b6
commit
50d70aa5de
@ -10,11 +10,10 @@ struct snake* add_snake(struct snake* snake,int x,int y){
|
||||
}
|
||||
|
||||
struct snake* remove_snake(struct snake* snake) {
|
||||
struct snake* head;
|
||||
struct snake* this = head;
|
||||
while (head!= NULL) {
|
||||
head = snake->next;
|
||||
free(this);
|
||||
struct snake* temp = snake;
|
||||
if (snake!= NULL) {
|
||||
snake = snake->next;
|
||||
free(temp);
|
||||
}
|
||||
return snake;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user