From 69eaba6642671f50882fd64c9d542bf574cde8ac Mon Sep 17 00:00:00 2001 From: Michal Utlak Date: Tue, 9 Apr 2024 17:29:13 +0200 Subject: [PATCH] variables --- cv9/snake.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cv9/snake.c b/cv9/snake.c index 20d79f7..985cc10 100644 --- a/cv9/snake.c +++ b/cv9/snake.c @@ -18,16 +18,16 @@ struct snake* remove_snake(struct snake* snake){ return NULL; } - struct snake* prev = NULL; - struct snake* current = snake; - while (current->next != NULL) { - prev = current; - current = current->next; + struct snake* predtym = NULL; + struct snake* teraz = snake; + while (teraz->next != NULL) { + predtym = teraz; + teraz = teraz->next; } - free(current); - prev->next = NULL; - + free(teraz); + predtym->next = NULL; + return snake; }