From 9f09c56775bda7e82573f85bec000e6b90e489fd Mon Sep 17 00:00:00 2001 From: ak643du Date: Thu, 11 Apr 2024 14:19:48 +0200 Subject: [PATCH] Initialization --- cv9/snake.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cv9/snake.c b/cv9/snake.c index 30b59b9..5f32908 100644 --- a/cv9/snake.c +++ b/cv9/snake.c @@ -12,7 +12,7 @@ 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 (this->next != NULL){ + if (this!= NULL) { this = this->next; free(this); }