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

[PATCH] SQUASH??? calloc(nmemb,size)

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 11, 2021, 18:02 UTC
Message-ID
<xmqqa6r9efgh.fsf@gitster.g>

Please squash this in to an appropriate step in your series; otherwise it triggers a Coccinelle check when merged to 'seen'.

Thanks.
 refs/reftable-backend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs/reftable-backend.c b/refs/reftable-backend.c
index b7d12ca91d..6faad8ce50 100644
--- a/refs/reftable-backend.c
+++ b/refs/reftable-backend.c
@@ -996,7 +996,7 @@ static struct ref_iterator_vtable git_reftable_reflog_ref_iterator_vtable = {
 static struct ref_iterator *
 git_reftable_reflog_iterator_begin(struct ref_store *ref_store)
 {
-	struct git_reftable_reflog_ref_iterator *ri = xcalloc(sizeof(*ri), 1);
+	struct git_reftable_reflog_ref_iterator *ri = xcalloc(1, sizeof(*ri));
 	struct git_reftable_ref_store *refs =
 		(struct git_reftable_ref_store *)ref_store;
 
-- 
2.31.0-rc2-173-g36b77366ca
Next: Han-Wen Nienhuys
Message 1 of 2 in “SQUASH??? calloc(nmemb,size)”
  1. SQUASH??? calloc(nmemb,size)Junio C Hamano, Mar 11, 2021
  2. Han-Wen NienhuysMar 15, 2021

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.