From 27e73757c474f6f86dc4f85a2aad1052420b4c2f Mon Sep 17 00:00:00 2001 From: Elijah Cohen Date: Wed, 16 Oct 2024 12:08:06 -0500 Subject: [PATCH] fixed major parser error hah --- src/parser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.39.2