From 4d6b5938c934cd108f3edb12038f3e8e07ea1b14 Mon Sep 17 00:00:00 2001 From: ak643du Date: Thu, 11 Apr 2024 14:25:11 +0200 Subject: [PATCH] Initialization --- cv9/snake.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cv9/snake.c b/cv9/snake.c index 91b4fc4..5e32b38 100644 --- a/cv9/snake.c +++ b/cv9/snake.c @@ -12,8 +12,8 @@ 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; - if (this!= NULL) { - this = snake->next; + if (head!= NULL) { + head = head->next; free(this); } return snake;