diff --git a/cv7/program.c b/cv7/program.c index 5171f62..a31b696 100644 --- a/cv7/program.c +++ b/cv7/program.c @@ -92,15 +92,14 @@ void interact(struct tree *node) char answer[SIZE]; while (fgets(answer, SIZE, stdin)) { - answer[strcspn(answer, "\n")] = 0; - - - if (answer[0] == '\0') + if (answer[0] == '\n') { printf("Koniec vstupu\n"); return; } + answer[strcspn(answer, "\n")] = 0; + if (strcmp(answer, "a") == 0) { interact(node->left);