This commit is contained in:
kr820js 2024-04-13 19:18:36 +02:00
parent fe913763f6
commit fddead63be

View File

@ -34,12 +34,11 @@ void free_snake(struct snake* sn){
return; return;
} }
struct snake* next_element; struct snake* next_element;
while(current->next!=NULL){ while(current!=NULL){
next_element=current->next; next_element=current->next;
free(current); free(current);
current=next_element; current=next_element;
} }
free(current);
} }
int is_snake(struct snake* snake,int x,int y){ int is_snake(struct snake* snake,int x,int y){
@ -58,3 +57,4 @@ int step_state(struct state* st){
int ny = (st->snake->y + st->sy); int ny = (st->snake->y + st->sy);
return END_CONTINUE; return END_CONTINUE;
} }