diff --git a/cv9/snake.c b/cv9/snake.c index 98c45c0..92baaf5 100644 --- a/cv9/snake.c +++ b/cv9/snake.c @@ -2,7 +2,7 @@ #include struct snake* add_snake(struct snake* snake,int x,int y){ - struct snake* hlavicka = (struct snake*)malloc(sizeof(struct snake)); + struct snake* hlavicka = calloc(1,sizeof(struct snake)); if (hlavicka == NULL) { return NULL; }