variables

This commit is contained in:
Michal Utľák 2024-04-09 17:29:13 +02:00
parent df7d0ccd00
commit 69eaba6642

View File

@ -18,15 +18,15 @@ struct snake* remove_snake(struct snake* snake){
return NULL; return NULL;
} }
struct snake* prev = NULL; struct snake* predtym = NULL;
struct snake* current = snake; struct snake* teraz = snake;
while (current->next != NULL) { while (teraz->next != NULL) {
prev = current; predtym = teraz;
current = current->next; teraz = teraz->next;
} }
free(current); free(teraz);
prev->next = NULL; predtym->next = NULL;
return snake; return snake;
} }