From d34f15fb478ca84bc23c1f7ea740ab67d0773708 Mon Sep 17 00:00:00 2001 From: Michal Utlak Date: Tue, 9 Apr 2024 17:00:42 +0200 Subject: [PATCH] assert --- cv9/snake.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cv9/snake.c b/cv9/snake.c index 7205579..a2ae686 100644 --- a/cv9/snake.c +++ b/cv9/snake.c @@ -1,5 +1,6 @@ #include "snake.h" #include +#include struct snake* add_snake(struct snake* snake,int x,int y){ struct snake* hlavicka = calloc(1,sizeof(struct snake)); @@ -20,7 +21,7 @@ struct snake* remove_snake(struct snake* snake){ struct snake* nova_hlavicka = snake->next; free(snake); - + assert(nova_hlavicka == NULL || nova_hlavicka->next == NULL); return nova_hlavicka;