From 18201f08c2e3eeca95b2b489438fdf6e7f518ed3 Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Sun, 22 Nov 2020 16:40:29 +0100 Subject: [PATCH] buffet --- cv8/program.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cv8/program.c b/cv8/program.c index e1bf72d..e457fcf 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -18,7 +18,11 @@ struct tree* read_tree(){ buffer[x-1]='\0'; assert(r); + if(buffer[0] == '\n'){ + return; + } + if(buffer[0] != '\0'){ struct tree* node = calloc(1,sizeof(struct tree)); memcpy(node->value, buffer,50); @@ -45,8 +49,8 @@ void search(struct tree* this){ return; } //char* r = fgets(buffer,5,stdin); - int x = strlen(buffer); - buffer[x-1]='\0'; + //int x = strlen(buffer); + //buffer[x-1]='\0'; if(buffer[0] == '\n'){ return;