This commit is contained in:
mr314ot 2025-11-20 19:33:34 +01:00
parent 388cc3b02d
commit f6246bb5ef

View File

@ -58,6 +58,17 @@ Tree* read_tree() {
return NULL;
}
// kontrola prebytocnych potomkov
long pos = ftell(stdin);
if (fgets(buffer, SIZE, stdin)) {
// ak sa nacitalo ine nez prazdny riadok → chyba
if (strcmp(buffer, "\n") != 0) {
valid_db = 0;
}
fseek(stdin, pos, SEEK_SET);
}
return node;
}