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

Re: [PATCH 2/7 (v5)] basic api and porcelain

From
Julian Phillips <julian@quantumfyre.co.uk>
Date
Apr 6, 2010, 19:25 UTC
Message-ID
<dbe35e7547614331d19b811c180731aa@212.159.54.234>
In-Reply-To
<4BBA40CD.5040301@gmail.com>
On Mon, 05 Apr 2010 20:58:05 +0100, Nick Edelen <sirnot@gmail.com> wrote:
> +	/* initialize header */
> +	strcpy(head.signature, "REVCACHE");

head.signature is 8 characters (see below), and so is "REVCACHE". Surely either head.signature needs to be 9 characters, or you shouldn't use strcpy. Indeed, mostly you do seem to be using memcpy ...

This is in a couple of other places too, with both rc_index_header, and rc_slice_header.

Show 11 quoted lines
> +/* single index maps objects to cache files */
> +struct rc_index_header {
> +	char signature[8]; /* REVINDEX */
> +	unsigned char version;
> +	uint32_t ofs_objects;
> +
> +	uint32_t object_nr;
> +	unsigned char cache_nr;
> +
> +	uint32_t max_date;
> +};
Show 12 quoted lines
> +/* structure for actual cache file */
> +struct rc_slice_header {
> +	char signature[8]; /* REVCACHE */
> +	unsigned char version;
> +	uint32_t ofs_objects;
> +
> +	uint32_t object_nr;
> +	uint16_t path_nr;
> +	uint32_t size;
> +
> +	unsigned char sha1[20];
> +};
-- 
Julian
Previous: Nick EdelenNext: Nick Edelen
Message 2 of 3 in “basic api and porcelain”
  1. 2/7 basic api and porcelainNick Edelen, Apr 5, 2010
  2. Julian PhillipsApr 6, 2010
  3. Nick EdelenApr 6, 2010

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.