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();