Initializacia
This commit is contained in:
parent
8109d836ab
commit
bdb10349f2
@ -20,12 +20,12 @@ struct tree* read_tree() {
|
||||
return NULL;
|
||||
}
|
||||
buffer[strcspn(buffer, "\n")] = 0;
|
||||
struct tree* node = calloc(1, sizeof(struct tree));
|
||||
if (buffer[0] == '*') {
|
||||
if (strlen(buffer) <= 1) {
|
||||
error_flag = 1;
|
||||
}
|
||||
|
||||
if (buffer[0] == '*' && buffer[1] == ' ') {
|
||||
error_flag = 1; // Invalid format if there's a space after '*'
|
||||
}
|
||||
|
||||
struct tree* node = calloc(1, sizeof(struct tree));
|
||||
strncpy(node->value, buffer, SIZE - 1);
|
||||
return node;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user