diff --git a/du7/snake.c b/du7/snake.c index ee76ecf..62569e7 100644 --- a/du7/snake.c +++ b/du7/snake.c @@ -49,6 +49,8 @@ void free_snake(struct snake* sn){ //funkcia odstráni hada z hry } int is_snake(struct snake* snake,int x,int y){ + if (snake == NULL) return 0; + do { if (snake->x == x || snake->y == y) return 1; } while (snake->next != NULL);