Initializacia

This commit is contained in:
Kozar 2024-11-12 17:59:15 +00:00
parent dd1da65481
commit 302f4d4987

View File

@ -14,7 +14,7 @@ struct tree {
struct tree* read_tree() {
char buffer[SIZE];
if (fgets(buffer, SIZE, stdin) == NULL || buffer[0] == '\n') {
return NULL;
return NULL; // Return NULL for empty input
}
buffer[strcspn(buffer, "\n")] = 0; // Remove newline character
struct tree* node = calloc(1, sizeof(struct tree));