diff --git a/cv8/program.c b/cv8/program.c index cf3bc47..c62f3dc 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -41,15 +41,10 @@ void search(struct tree* this){ memset(buffer,0,5); char* r = fgets(buffer,5,stdin); - if(fgets(buffer, 5, stdin) == NULL){ + if(r == NULL){ printf("Koniec vstupu\n"); exit(0); - } - - /*if(buffer[0] == '\n'){ - char* r = fgets(buffer,5,stdin); - } */ - + } if(buffer[0] == 'a'){ if(this->left->value[0] == '*'){ printf("%s\n", this->left->value); @@ -130,10 +125,10 @@ int count_all(struct tree* node){ int main(){ struct tree* tree = NULL; + printf("Expert z bufetu to vie.\n"); tree = read_tree(); int count = count_leaves(tree); - printf("Expert z bufetu to vie.\n"); printf("Pozna %d druhov ovocia a zeleniny.\n", count); printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.\n");