Re: [PATCH v4 11/12] builtin/rerere: use `OPT_SUBCOMMAND()`
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 18, 2026, 17:02 UTC
- Message-ID
- <xmqqse0y6pjf.fsf@gitster.g>
- In-Reply-To
- <av2xpF67qs6S0Hb7@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 11 quoted lines
>> > + 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.