This commit is contained in:
Valér Jakubčo 2021-11-26 03:58:23 +01:00
parent 052f0216b1
commit 36b5a782a7

View File

@ -18,7 +18,11 @@ struct node* read_tree(int* count, int* leafs){
char buffer[SIZE]; char buffer[SIZE];
memset(buffer,0,SIZE); memset(buffer,0,SIZE);
char* r = fgets(buffer,SIZE,stdin); char* r = fgets(buffer,SIZE,stdin);
assert(r); if(r == NULL){
puts("Expert z bufetu to vie.");
puts("Chybna databaza");
exit(0);
}
struct node* node = calloc(1,sizeof(struct node)); struct node* node = calloc(1,sizeof(struct node));
memcpy(node->data,buffer,SIZE); memcpy(node->data,buffer,SIZE);
if(r[0]!='*'){ if(r[0]!='*'){