diff --git a/du7/snake.c b/du7/snake.c index 9fbdebf..02be7e7 100644 --- a/du7/snake.c +++ b/du7/snake.c @@ -8,6 +8,8 @@ struct snake* add_snake(struct snake* snake,int x,int y){ if (snake != NULL) { snake->next = novyZaciatok; + } else { + snake->next = NULL; } return novyZaciatok;