]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
basenc: prefer xpalloc to xnrealloc
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 8 Nov 2024 06:32:41 +0000 (22:32 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 9 Nov 2024 07:41:18 +0000 (23:41 -0800)
* src/basenc.c (prepare_inbuf): Prefer xpalloc to xnrealloc.

src/basenc.c

index ba3186a2225f305d6c67c21971a96699f002aa91..f9b364d3aae94d86413445248cd59ccd364e393e 100644 (file)
@@ -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);
 }