From 7e86be8dbb62441430a252ab759cec3e85b4afdd Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 6 Nov 2024 16:21:15 -0800 Subject: [PATCH] env: prefer xpalloc to x2nrealloc * src/env.c (usvars_alloc): Use idx_t for size. (append_unset_var): Use xpalloc instead of x2nrealloc. --- src/env.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/env.c b/src/env.c index af876fa08..45c94ed09 100644 --- a/src/env.c +++ b/src/env.c @@ -38,7 +38,7 @@ /* Array of envvars to unset. */ static char const **usvars; -static size_t usvars_alloc; +static idx_t usvars_alloc; static idx_t usvars_used; /* Annotate the output with extra info to aid the user. */ @@ -171,7 +171,7 @@ static void append_unset_var (char const *var) { if (usvars_used == usvars_alloc) - usvars = x2nrealloc (usvars, &usvars_alloc, sizeof *usvars); + usvars = xpalloc (usvars, &usvars_alloc, 1, -1, sizeof *usvars); usvars[usvars_used++] = var; } -- 2.11.4.GIT