diff --git a/du5/program.c b/du5/program.c index a0504f4..214b0ff 100644 --- a/du5/program.c +++ b/du5/program.c @@ -18,7 +18,8 @@ Tree* readTree() { if (fgets(line, SIZE, stdin) == NULL) return NULL; // якщо пустий рядок → кінець бази - if (strcmp(line, "\n") == 0) return NULL; + line[strcspn(line, "\r\n")] = 0; + if (line[0] == '\0') return NULL; Tree *node = malloc(sizeof(Tree)); node->yes = NULL;