提交 2f664566 编写于 作者: J Junio C Hamano

Merge branch 'jk/tighten-alloc'

Small code and comment clean-up.

* jk/tighten-alloc:
  receive-pack: use FLEX_ALLOC_MEM in queue_command()
  correct FLEXPTR_* example in comment
......@@ -1478,11 +1478,9 @@ static struct command **queue_command(struct command **tail,
refname = line + 82;
reflen = linelen - 82;
cmd = xcalloc(1, st_add3(sizeof(struct command), reflen, 1));
FLEX_ALLOC_MEM(cmd, ref_name, refname, reflen);
hashcpy(cmd->old_sha1, old_sha1);
hashcpy(cmd->new_sha1, new_sha1);
memcpy(cmd->ref_name, refname, reflen);
cmd->ref_name[reflen] = '\0';
*tail = cmd;
return &cmd->next;
}
......
......@@ -815,7 +815,7 @@ extern FILE *fopen_for_writing(const char *path);
* you can do:
*
* struct foo *f;
* FLEX_ALLOC_STR(f, name, src);
* FLEXPTR_ALLOC_STR(f, name, src);
*
* and "name" will point to a block of memory after the struct, which will be
* freed along with the struct (but the pointer can be repointed anywhere).
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册