From 22fd9ec0ae7f0ed37c7d69bc271d1b5f264048d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Vasi=C4=BE?= Date: Wed, 27 Apr 2022 18:55:57 +0200 Subject: [PATCH] domaca_uloha_7 --- du7/snake.c | 2 ++ 1 file changed, 2 insertions(+) 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);