Initialization

This commit is contained in:
Kozar 2024-04-11 14:40:02 +02:00
parent f34a09b2b6
commit 50d70aa5de

View File

@ -10,11 +10,10 @@ struct snake* add_snake(struct snake* snake,int x,int y){
} }
struct snake* remove_snake(struct snake* snake) { struct snake* remove_snake(struct snake* snake) {
struct snake* head; struct snake* temp = snake;
struct snake* this = head; if (snake!= NULL) {
while (head!= NULL) { snake = snake->next;
head = snake->next; free(temp);
free(this);
} }
return snake; return snake;
} }