From: Elijah Cohen Date: Wed, 16 Oct 2024 17:08:06 +0000 (-0500) Subject: fixed major parser error hah X-Git-Url: https://git.eli173.com/?a=commitdiff_plain;h=27e73757c474f6f86dc4f85a2aad1052420b4c2f;p=klapaucius fixed major parser error hah --- diff --git a/src/parser.c b/src/parser.c index 202e289..ae709ec 100644 --- a/src/parser.c +++ b/src/parser.c @@ -11,8 +11,9 @@ Sexpr* append_fragment(Sexpr* tokens, char* tok_start, size_t currlen) { // helper so that i dont repeat code - char* newsym = malloc(sizeof(char)*currlen); + char* newsym = malloc(sizeof(char)*currlen+1); strncpy(newsym, tok_start, currlen); + newsym[sizeof(char)*currlen] = '\0'; Sexpr* newtok = from_sym(newsym); free(newsym); return cons(newtok, tokens);