git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git segfault in tag verify (patch included)

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 16, 2019, 19:17 UTC
Message-ID
<xmqqk1ch3i1s.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190716185835.GA24468@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 9 quoted lines
> Something like:
>
>   for (line = buf; *line; line = next) {
> 	next = strchrnul(line, '\n');
>
> 	... do stuff ...
> 	/* find a space within the line */
> 	space = memchr(line, ' ', next - line);
>   }

I am not sure about the memchr() thing, but "prepare next that is constant thru the iteration, and update line to it at the end of each iteration" is a robust pattern to follow. I like it.

Previous: Jeff King
Message 5 of 5 in “git segfault in tag verify (patch included)”
  1. Steven RobertsJul 16, 2019
  2. Junio C HamanoJul 16, 2019
  3. Steven RobertsJul 16, 2019
  4. Jeff KingJul 16, 2019
  5. Junio C HamanoJul 16, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.