Initializacia
This commit is contained in:
parent
dd1da65481
commit
302f4d4987
@ -14,7 +14,7 @@ struct tree {
|
|||||||
struct tree* read_tree() {
|
struct tree* read_tree() {
|
||||||
char buffer[SIZE];
|
char buffer[SIZE];
|
||||||
if (fgets(buffer, SIZE, stdin) == NULL || buffer[0] == '\n') {
|
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
|
buffer[strcspn(buffer, "\n")] = 0; // Remove newline character
|
||||||
struct tree* node = calloc(1, sizeof(struct tree));
|
struct tree* node = calloc(1, sizeof(struct tree));
|
||||||
|
Loading…
Reference in New Issue
Block a user