use calloc instead of malloc for token because next was sometimes unitialized
This commit is contained in:
parent
b6747a40eb
commit
d5290ad483
1 changed files with 1 additions and 1 deletions
|
@ -59,7 +59,7 @@ Token* tokenize(char* input) {
|
|||
}
|
||||
|
||||
Token* token_create(char* value, TokenType type, Token* root) {
|
||||
Token* new_token = malloc(sizeof(Token));
|
||||
Token* new_token = calloc(1, sizeof(Token));
|
||||
new_token->value = value;
|
||||
new_token->type = type;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue