From 36b5a782a71a16c1f5f0ba5e19f8757030c8f8f9 Mon Sep 17 00:00:00 2001 From: vj586da Date: Fri, 26 Nov 2021 03:58:23 +0100 Subject: [PATCH] final --- cv8/program.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cv8/program.c b/cv8/program.c index 758caa4..f76a546 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -18,7 +18,11 @@ struct node* read_tree(int* count, int* leafs){ char buffer[SIZE]; memset(buffer,0,SIZE); char* r = fgets(buffer,SIZE,stdin); - assert(r); + if(r == NULL){ + puts("Expert z bufetu to vie."); + puts("Chybna databaza"); + exit(0); + } struct node* node = calloc(1,sizeof(struct node)); memcpy(node->data,buffer,SIZE); if(r[0]!='*'){