null v remove snake

This commit is contained in:
Aleš Novysedlák 2025-04-08 17:08:44 +02:00
parent e0d1836e55
commit a1c8c93d51

View File

@ -10,7 +10,8 @@ struct snake* add_snake(struct snake* snake,int x,int y){
}
struct snake* remove_snake(struct snake* snake){
struct snake* part = snake;
struct snake* part = snake;
if (snake == NULL) return NULL;
if (part->next == NULL) {
free(part);
return NULL;