diff --git a/cv8/program.c b/cv8/program.c index 9b14fab..ec6fadd 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -27,20 +27,20 @@ struct tree* read_tree(int* counter){ struct tree* node = calloc(1,sizeof(struct tree)); memcpy(node->value, buffer,50); *c += 1; - counter = &c; + counter = c; if(buffer[0] != '*'){ if(node->left == NULL){ - node->left = read_tree(); + node->left = read_tree(counter); } if(node->right == NULL){ - node->right = read_tree(); + node->right = read_tree(counter); } } if(node->left != NULL && node->right != NULL){ *c -= 2; - counter = &c; + counter = c; } - if(c == 1){ + if(*c == 1){ r = fgets(buffer,50, stdin); //int x = strlen(buffer); // buffer[x-1]='\0';