aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-06-25 11:56:58 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-06-25 11:56:58 +0200
commit3efd91c401fad2f77be954f3ad2cfcc3ee0a7108 (patch)
tree056c13b4ada83f715bfd77def1781444689827ab
parent91d4545d23963e9cc774b2c27e54ec1412fe5785 (diff)
Initialize aux length to 0
-rw-r--r--src/parser.c4
1 files changed, 3 insertions, 1 deletions
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);