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

[PATCH 2/4] read-cache: trivial style cleanups

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 30, 2013, 13:56 UTC
Message-ID
<1369922181-31016-3-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<1369922181-31016-1-git-send-email-felipe.contreras@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 read-cache.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/read-cache.c b/read-cache.c
index 5253ec5..7040e79 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -979,7 +979,7 @@ int add_index_entry(struct index_state *istate, struct cache_entry *ce, int opti
 	if (istate->cache_nr == istate->cache_alloc) {
 		istate->cache_alloc = alloc_nr(istate->cache_alloc);
 		istate->cache = xrealloc(istate->cache,
-					istate->cache_alloc * sizeof(struct cache_entry *));
+					istate->cache_alloc * sizeof(*istate->cache));
 	}
 
 	/* Add it in.. */
@@ -1449,7 +1449,7 @@ int read_index_from(struct index_state *istate, const char *path)
 	istate->version = ntohl(hdr->hdr_version);
 	istate->cache_nr = ntohl(hdr->hdr_entries);
 	istate->cache_alloc = alloc_nr(istate->cache_nr);
-	istate->cache = xcalloc(istate->cache_alloc, sizeof(struct cache_entry *));
+	istate->cache = xcalloc(istate->cache_alloc, sizeof(*istate->cache));
 	istate->initialized = 1;
 
 	if (istate->version == 4)
-- 
1.8.3.rc3.312.g47657de
Previous: Junio C HamanoNext: Felipe Contreras
Message 4 of 8 in “Trivial patches”
  1. 0/4 Trivial patchesFelipe Contreras, May 30, 2013
  2. 1/4 read-cache: fix wrong 'the_index' usageFelipe Contreras, May 30, 2013
  3. Junio C HamanoJun 3, 2013
  4. 2/4 read-cache: trivial style cleanupsFelipe Contreras, May 30, 2013
  5. 3/4 unpack-trees: trivial cleanupFelipe Contreras, May 30, 2013
  6. Junio C HamanoJun 3, 2013
  7. Felipe ContrerasJun 3, 2013
  8. 4/4 sha1_file: trivial style cleanupFelipe Contreras, May 30, 2013

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.