From 8921ce29627b45d78d1870d550418fc3d13dcdbe Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sat, 30 Apr 2022 05:28:06 -0700 Subject: grow memory for visits as needed --- comp.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'comp.c') diff --git a/comp.c b/comp.c index 9427363..7b2c575 100644 --- a/comp.c +++ b/comp.c @@ -82,6 +82,8 @@ struct segment next_dart(int rem, int darts_in_hand) void comp_visit(struct leg *l) { + if (l->n_visits == l->size_visits) + leg_grow_visits(l); struct visit *v = l->visits + l->n_visits++; v->darts = calloc(3, sizeof(*(v->darts))); v->ccoords = calloc(3, sizeof(*(v->ccoords))); -- cgit v1.2.3-70-g09d2