Re: [PATCH 3/2] commit: remove find_header_mem()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 20, 2024, 18:12 UTC
- Message-ID
- <xmqqr0crv5yi.fsf@gitster.g>
- In-Reply-To
- <20240619173106.GA1519400@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 8 quoted lines
>> +const char *find_commit_header(const char *msg, const char *key, size_t *out_len)
>> {
>> int key_len = strlen(key);
>> const char *line = msg;
>
> Not new in your patch, but assigning strlen() to int tingled my
> spider-sense. It's OK, though, because "key" is always a small string
> literal.Yup. All callers of find_commit_header() give in-program constants and never an externally sourced random string there.
> So the conversion looks good to me.
Thanks. Will queue.