diff --git a/du7/snake.c b/du7/snake.c index 8447a40..04f789f 100644 --- a/du7/snake.c +++ b/du7/snake.c @@ -84,7 +84,7 @@ int step_state(struct state* st){ } } - for(struct snake* temp = st->snake->next != NULL; temp = temp->next){ + for(struct snake* temp = st->snake; temp != NULL; temp = temp->next){ if((nx == temp->x && ny == temp->y) || (nx < 0 || nx >= st->width || ny < 0 || ny >= st->height)){ return END_SNAKE; }