Изменить 'du7/snake.c'
This commit is contained in:
parent
0463e59800
commit
cd786b6e1c
@ -29,7 +29,11 @@ struct snake* add_snake(struct snake* snake,int x,int y){
|
||||
struct snake* remove_snake(struct snake* snake){
|
||||
struct snake* temp = snake;
|
||||
|
||||
if(snake == NULL || snake->next == NULL){
|
||||
if(snake == NULL){
|
||||
return snake;
|
||||
}
|
||||
else if(snake->next == NULL){
|
||||
free(snake);
|
||||
return snake;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user