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

[PATCH 1/2] midx.c: convert FLEX_ALLOC_MEM to FLEX_ALLOC_STR

From
Denton Liu <liu.denton@gmail.com>
Date
Apr 3, 2019, 22:00 UTC
Message-ID
<48c968a2923f76ab759327d21b37de86f7a61236.1554328261.git.liu.denton@gmail.com>
In-Reply-To
<cover.1554328261.git.liu.denton@gmail.com>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 midx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/midx.c b/midx.c
index 8a505fd423..cb8190329a 100644
--- a/midx.c
+++ b/midx.c
@@ -70,7 +70,7 @@ struct multi_pack_index *load_multi_pack_index(const char *object_dir, int local
 
 	midx_map = xmmap(NULL, midx_size, PROT_READ, MAP_PRIVATE, fd, 0);
 
-	FLEX_ALLOC_MEM(m, object_dir, object_dir, strlen(object_dir));
+	FLEX_ALLOC_STR(m, object_dir, object_dir);
 	m->fd = fd;
 	m->data = midx_map;
 	m->data_len = midx_size;
-- 
2.21.0.834.geaa57a21fa
Previous: Denton LiuNext: Denton Liu
Message 2 of 4 in “create FLEX_ALLOC_MEM to FLEX_ALLOC_STR cocci rule”
  1. 0/2 create FLEX_ALLOC_MEM to FLEX_ALLOC_STR cocci ruleDenton Liu, Apr 3, 2019
  2. 1/2 midx.c: convert FLEX_ALLOC_MEM to FLEX_ALLOC_STRDenton Liu, Apr 3, 2019
  3. 2/2 cocci: FLEX_ALLOC_MEM to FLEX_ALLOC_STRDenton Liu, Apr 3, 2019
  4. Jeff KingApr 4, 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.