Fix tokens.c missing-error-code bug.

This commit is contained in:
Sage Vaillancourt 2021-12-15 14:25:09 -05:00 committed by Sage Vaillancourt
parent d36f1bf162
commit c0ad4481bd
1 changed files with 1 additions and 0 deletions

View File

@ -137,6 +137,7 @@ struct Slice *nf_tokenize(const char *input, struct Error *err)
if(parens != 0){
err->context = malloc(sizeof(char) * ERR_LEN);
err->code = MISMATCHED_PARENS;
int start = i > ERR_LEN ? i - ERR_LEN : 0;
strncpy(err->context, &input[start], ERR_LEN);
free(slices);