diff --git a/du5/snake.c b/du5/snake.c index 876b570..95047b2 100644 --- a/du5/snake.c +++ b/du5/snake.c @@ -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;