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