From 6e808e674b74890f5361166b2157d1ed1b2bec2e Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Sat, 21 Nov 2020 16:34:20 +0100 Subject: [PATCH] buffet --- cv8/program.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cv8/program.c b/cv8/program.c index 58bbf43..6f82738 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -24,11 +24,13 @@ struct tree* read_tree(){ char* r = fgets(buffer,20,stdin); int x = strlen(buffer); buffer[x-1]='\0'; - if(buffer[0] == '\0'){ - exit(0); - } + assert(r); struct tree* node = calloc(1,sizeof(struct tree)); + if(buffer[0] == '\0'){ + return node; + } + memcpy(node->value, buffer, 20); /*if(node == NULL){ return create_node();