From 3efd91c401fad2f77be954f3ad2cfcc3ee0a7108 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 25 Jun 2024 11:56:58 +0200 Subject: Initialize aux length to 0 --- src/parser.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/parser.c b/src/parser.c index 46a1fb6..c4b9c8e 100644 --- a/src/parser.c +++ b/src/parser.c @@ -80,7 +80,9 @@ ast_t parsetoks(lexemes_t toks, aux_t *aux) { ast_t ast = mkast(); - aux->buf = bufalloc(NULL, aux->cap = AUX_DFLT_CAP, sizeof(*aux->buf)); + aux->len = 0; + aux->cap = AUX_DFLT_CAP; + aux->buf = bufalloc(NULL, aux->cap, sizeof(*aux->buf)); for (;;) { (void)parsedecl(&ast, aux, toks, true); -- cgit v1.2.3