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

Re: [PATCH 1/5] remote: trivial style cleanup

From
Junio C Hamano <gitster@pobox.com>
Date
May 28, 2013, 17:04 UTC
Message-ID
<7v38t72fyi.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1369745671-22418-2-git-send-email-felipe.contreras@gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 16 quoted lines
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>  remote.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/remote.c b/remote.c
> index 68eb99b..e71f66d 100644
> --- a/remote.c
> +++ b/remote.c
> @@ -1474,8 +1474,7 @@ struct branch *branch_get(const char *name)
>  		ret->remote = remote_get(ret->remote_name);
>  		if (ret->merge_nr) {
>  			int i;
> -			ret->merge = xcalloc(sizeof(*ret->merge),
> -					     ret->merge_nr);
> +			ret->merge = xcalloc(ret->merge_nr, sizeof(*ret->merge));
Yeah, calloc is nmemb first and then size, so this makes sense.
>  			for (i = 0; i < ret->merge_nr; i++) {
>  				ret->merge[i] = xcalloc(1, sizeof(**ret->merge));
>  				ret->merge[i]->src = xstrdup(ret->merge_name[i]);
Previous: Felipe ContrerasNext: Felipe Contreras
Message 3 of 13 in “Trivial patches”
  1. 0/5 Trivial patchesFelipe Contreras, May 28, 2013
  2. 1/5 remote: trivial style cleanupFelipe Contreras, May 28, 2013
  3. Junio C HamanoMay 28, 2013
  4. 2/5 sequencer: trivial fixFelipe Contreras, May 28, 2013
  5. 3/5 test: trivial cleanupsFelipe Contreras, May 28, 2013
  6. 4/5 test: improve rebase -q testFelipe Contreras, May 28, 2013
  7. Junio C HamanoMay 28, 2013
  8. Jonathan NiederMay 28, 2013
  9. Junio C HamanoMay 28, 2013
  10. Felipe ContrerasMay 29, 2013
  11. Junio C HamanoMay 29, 2013
  12. Felipe ContrerasMay 29, 2013
  13. 5/5 test: rebase: fix --interactive testFelipe Contreras, May 28, 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.