Initializacia
This commit is contained in:
parent
f256260aca
commit
9f4c372547
@ -51,9 +51,11 @@ void run_tree(struct tree* tree) {
|
||||
printf("%s\n", tree->value);
|
||||
|
||||
char response;
|
||||
if (scanf(" %c", &response) != 1 || (response != 'a' && response != 'n')) {
|
||||
error_flag = 1;
|
||||
if (scanf(" %c", &response) != 1) {
|
||||
printf("Chybna databaza\n");
|
||||
return;
|
||||
} else if (response != 'a' && response != 'n'){
|
||||
printf("Nerozumiem\n");
|
||||
}
|
||||
|
||||
if (response == 'a') {
|
||||
@ -99,10 +101,6 @@ int main() {
|
||||
|
||||
run_tree(root);
|
||||
|
||||
if (error_flag) {
|
||||
printf("Chybna databaza\n");
|
||||
}
|
||||
|
||||
destroy_tree(root);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user