This commit is contained in:
Vadym Afanasiev 2026-04-16 21:20:20 +00:00
parent 5891f836d7
commit 5188465dc6

View File

@ -115,7 +115,21 @@ int main() {
}
char dummy[LINE_SIZE];
fgets(dummy, sizeof(dummy), stdin);
if (fgets(dummy, sizeof(dummy), stdin) == NULL) {
printf("Expert z bufetu to vie.\n");
printf("Chybna databaza\n");
cleanup_tree(root);
return 0;
}
dummy[strcspn(dummy, "\n\r")] = '\0';
if (strlen(dummy) != 0) {
printf("Expert z bufetu to vie.\n");
printf("Chybna databaza\n");
cleanup_tree(root);
return 0;
}
int answer_count = how_many_answers(root);