This commit is contained in:
Michal Utľák 2024-04-09 17:00:42 +02:00
parent af6540d032
commit d34f15fb47

View File

@ -1,5 +1,6 @@
#include "snake.h"
#include <stdlib.h>
#include <assert.h>
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;