cv7
This commit is contained in:
parent
190e67862e
commit
2adc3595d9
@ -1,7 +1,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#define SIZE 100
|
||||
|
||||
@ -18,11 +17,9 @@ struct tree* read_tree(int* counter) {
|
||||
if (buffer[0] == '\n') {
|
||||
return NULL;
|
||||
}
|
||||
assert(r);
|
||||
struct tree* tree = calloc(1, sizeof(struct tree));
|
||||
tree->value = malloc(strlen(buffer) + 1);
|
||||
strcpy(tree->value, buffer);
|
||||
assert(tree->value);
|
||||
if (buffer[0] == '*') {
|
||||
(*counter)++;
|
||||
return tree;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user