use calloc instead of malloc for token because next was sometimes unitialized

This commit is contained in:
sam 2024-07-21 11:55:37 +12:00
parent b6747a40eb
commit d5290ad483

View file

@ -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;