diff --git a/du7/snake.c b/du7/snake.c index c600b67..2431a7d 100644 --- a/du7/snake.c +++ b/du7/snake.c @@ -64,7 +64,7 @@ void free_snake(struct snake* sn){ int is_snake(struct snake* snake,int x,int y){ struct snake* temp = snake; - while(temp->next != NULL){ + while(temp != NULL){ if(x == temp->x && y == temp->y){ return 1; }