From 104bd5e370f99c8dd3d9e2828b301dbeb6a8dbb5 Mon Sep 17 00:00:00 2001 From: oaq Date: Thu, 27 Feb 2025 21:21:15 +1100 Subject: [PATCH] addpeph: grow the size at a faster rate --- src/preceph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/preceph.c b/src/preceph.c index 19a4676d3..0777c9d29 100644 --- a/src/preceph.c +++ b/src/preceph.c @@ -159,7 +159,7 @@ static int addpeph(nav_t *nav, peph_t *peph) peph_t *nav_peph; if (nav->ne>=nav->nemax) { - nav->nemax+=256; + nav->nemax += nav->nemax < 4 ? 1 : nav->nemax / 4; if (!(nav_peph=(peph_t *)realloc(nav->peph,sizeof(peph_t)*nav->nemax))) { trace(1,"readsp3b malloc error n=%d\n",nav->nemax); free(nav->peph); nav->peph=NULL; nav->ne=nav->nemax=0;