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;