This commit is contained in:
Maryna Kravtsova 2020-11-22 16:40:29 +01:00
parent 5172cb16f4
commit 18201f08c2

View File

@ -18,7 +18,11 @@ struct tree* read_tree(){
buffer[x-1]='\0'; buffer[x-1]='\0';
assert(r); assert(r);
if(buffer[0] == '\n'){
return;
}
if(buffer[0] != '\0'){ if(buffer[0] != '\0'){
struct tree* node = calloc(1,sizeof(struct tree)); struct tree* node = calloc(1,sizeof(struct tree));
memcpy(node->value, buffer,50); memcpy(node->value, buffer,50);
@ -45,8 +49,8 @@ void search(struct tree* this){
return; return;
} }
//char* r = fgets(buffer,5,stdin); //char* r = fgets(buffer,5,stdin);
int x = strlen(buffer); //int x = strlen(buffer);
buffer[x-1]='\0'; //buffer[x-1]='\0';
if(buffer[0] == '\n'){ if(buffer[0] == '\n'){
return; return;