du6 - 24
This commit is contained in:
parent
3c9a53fbdb
commit
8bfed13581
@ -29,6 +29,8 @@ Tree* read_tree() {
|
||||
if (strcmp(buffer, "\n") == 0)
|
||||
return NULL;
|
||||
|
||||
strip_newline(buffer);
|
||||
|
||||
Tree *node = calloc(1, sizeof(Tree));
|
||||
strcpy(node->value, buffer);
|
||||
|
||||
@ -69,15 +71,11 @@ int run_system(Tree *node) {
|
||||
|
||||
char c[10];
|
||||
printf("%s\n", node->value);
|
||||
while (1) {
|
||||
if (fgets(c, sizeof(c), stdin) == NULL) {
|
||||
printf("Koniec vstupu\n");
|
||||
return 0;
|
||||
}
|
||||
strip_newline(c);
|
||||
|
||||
if (strlen(c) != 0) break;
|
||||
if (fgets(c, sizeof(c), stdin) == NULL) {
|
||||
printf("Koniec vstupu\n");
|
||||
return 0;
|
||||
}
|
||||
strip_newline(c);
|
||||
|
||||
if (!node->left && !node->right) {
|
||||
printf("Koniec vstupu\n");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user