This commit is contained in:
Maryna Kravtsova 2020-11-21 16:34:20 +01:00
parent 437b0b7d19
commit 6e808e674b

View File

@ -24,11 +24,13 @@ struct tree* read_tree(){
char* r = fgets(buffer,20,stdin); char* r = fgets(buffer,20,stdin);
int x = strlen(buffer); int x = strlen(buffer);
buffer[x-1]='\0'; buffer[x-1]='\0';
if(buffer[0] == '\0'){
exit(0);
}
assert(r); assert(r);
struct tree* node = calloc(1,sizeof(struct tree)); struct tree* node = calloc(1,sizeof(struct tree));
if(buffer[0] == '\0'){
return node;
}
memcpy(node->value, buffer, 20); memcpy(node->value, buffer, 20);
/*if(node == NULL){ /*if(node == NULL){
return create_node(); return create_node();