From 9308618678d5dceaca4cff94a35fed01e06a1c3c Mon Sep 17 00:00:00 2001 From: Weber Date: Tue, 16 Apr 2024 16:10:43 +0000 Subject: [PATCH] test --- cv9/snake.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cv9/snake.c b/cv9/snake.c index e5d0345..ffb92a7 100644 --- a/cv9/snake.c +++ b/cv9/snake.c @@ -10,8 +10,11 @@ struct snake* add_snake(struct snake* snake, int x, int y) { return hlava; } -struct snake* remove_snake(struct snake* snake){ - return NULL; +struct snake* remove_snake(struct snake* snake) { + if (snake == NULL) return NULL; + struct snake* new_head = snake->next; + free(snake); + return new_head; } void free_snake(struct snake* sn){