From: Junio C Hamano Date: Wed, 18 Nov 2026 17:02:44 GMT Subject: Re: [PATCH v4 11/12] builtin/rerere: use `OPT_SUBCOMMAND()` Message-ID: In-Reply-To: Patrick Steinhardt writes: >> > + CALLOC_ARRAY(args_copy, args.nr); >> > + COPY_ARRAY(args_copy, args.v, args.nr); >> >> Does args.nr count the terminating NULL pointer? We mimic the >> familiar (ac, av) convention of the C language; av[ac] being NULL is >> also part of the convention, so if CALLOC_ARRAY() is not allocating >> an entry for the terminating NULL and COPY_ARRAY() is not copying >> args together with the NULL, this may want to be corrected. > > That's a good point indeed. It likely doesn't matter, but better be safe > than sorry. Will adapt. The COPY_ARRAY() call can stay as-is. CALLOC_ARRAY() needs to allocate one more element.