From d00ab4d1106d81b9299c96ec4ec50d9f17172a2d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 7 Nov 2024 22:32:41 -0800 Subject: [PATCH] basenc: prefer xpalloc to xnrealloc * src/basenc.c (prepare_inbuf): Prefer xpalloc to xnrealloc. --- src/basenc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/basenc.c b/src/basenc.c index ba3186a222..f9b364d3aa 100644 --- a/src/basenc.c +++ b/src/basenc.c @@ -325,10 +325,8 @@ static void prepare_inbuf (struct base_decode_context *ctx, idx_t inlen) { if (ctx->bufsize < inlen) - { - ctx->bufsize = inlen * 2; - ctx->inbuf = xnrealloc (ctx->inbuf, ctx->bufsize, sizeof (char)); - } + ctx->inbuf = xpalloc (ctx->inbuf, &ctx->bufsize, + inlen - ctx->bufsize, -1, sizeof *ctx->inbuf); } -- 2.47.2