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

Re: [PATCH] revision.c: use proper data type in call to sizeof() within xrealloc

From
Jeff King <peff@peff.net>
Date
Nov 14, 2008, 06:24 UTC
Message-ID
<20081114062434.GA11907@coredump.intra.peff.net>
In-Reply-To
<2NXgsahhUCpkej6JukLNJjebzyoAQgZ4ptQMMrR2j_iWS5yEqKYn0kxHsUBpiY6bkpfbTjxlSn0@cipher.nrlssc.navy.mil>
On Thu, Nov 13, 2008 at 02:20:37PM -0600, Brandon Casey wrote:
Show 5 quoted lines
>  	int num = ++revs->num_ignore_packed;
>  
>  	revs->ignore_packed = xrealloc(revs->ignore_packed,
> -				       sizeof(const char **) * (num + 1));
> +				       sizeof(const char *) * (num + 1));
Maybe it would be even nicer as "sizeof(*revs->ignore_packed)"?
-Peff
Previous: Brandon Casey
Message 2 of 2 in “revision.c: use proper data type in call to sizeof() within xrealloc”
  1. revision.c: use proper data type in call to sizeof() within xreallocBrandon Casey, Nov 13, 2008
  2. Jeff KingNov 14, 2008

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.