# Re: (patch) calloc->xaclloc in read-cache.c

2 messages from 2006-05-09 to 2006-05-09. Participants: iler.ml@gmail.com, Junio C Hamano.
Thread: https://gitlist.dev/t/4111

## Junio C Hamano, 2006-05-09 13:26

Subject: Re: (patch) calloc->xaclloc in read-cache.c
Message-ID: <7vpsin5nx8.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vpsin5nx8.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <0IZ000KI11YCKL10@mxout4.netvision.net.il>

```
iler.ml@gmail.com writes:

> How about this.

Looks good, thanks.  If you needed some MUA trick that other
people might benefit from please feel free to send a patch to
Documentation/SubmittingPatches "MUA specific hints" section.

Except "Subject: [PATCH] blah", commit log message (in this case
what you would have on the Subject line is to the point and you
would not need any extra log message), "Signed-off-by: whom",
and perhaps "---\n".  Material that you do not want to have in
the final commit message, like "How about this" and diffstat if
you have one, would come after the "---\n" line.

Your message formatted in the preferred way becomes like this:

	Subject: [PATCH] read-cache.c: use xcalloc() not calloc()

	Elsewhere we use xcalloc(); we should consistently do so.

        Signed-off-by: Yakov Lerner <iler.ml@gmail.com>
	---

        * How about this?

         read-cache.c |    2 +-
         1 files changed, 1 insertions(+), 1 deletions(-)

        --- read-cache.c.000	2006-05-09 15:27:56.000000000 +0000
        +++ read-cache.c	2006-05-09 15:28:10.000000000 +0000
        @@ -552,7 +552,7 @@

                active_nr = ntohl(hdr->hdr_entries);
	...

```

## iler.ml@gmail.com, 2006-05-09 16:14

Subject: Re: (patch) calloc->xaclloc in read-cache.c
Message-ID: <0IZ000KI11YCKL10@mxout4.netvision.net.il>
URL: https://gitlist.dev/e/0IZ000KI11YCKL10%40mxout4.netvision.net.il

```
How about this.

--- read-cache.c.000	2006-05-09 15:27:56.000000000 +0000
+++ read-cache.c	2006-05-09 15:28:10.000000000 +0000
@@ -552,7 +552,7 @@
 
 	active_nr = ntohl(hdr->hdr_entries);
 	active_alloc = alloc_nr(active_nr);
-	active_cache = calloc(active_alloc, sizeof(struct cache_entry *));
+	active_cache = xcalloc(active_alloc, sizeof(struct cache_entry *));
 
 	offset = sizeof(*hdr);
 	for (i = 0; i < active_nr; i++) {

```
