Replace xmalloc+memset(0) with xcalloc.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:

committed by
Junio C Hamano

parent
8e44025925
commit
90321c106c
@ -21,8 +21,7 @@ static struct entry * convert_entry(unsigned char *sha1);
|
||||
|
||||
static struct entry *insert_new(unsigned char *sha1, int pos)
|
||||
{
|
||||
struct entry *new = xmalloc(sizeof(struct entry));
|
||||
memset(new, 0, sizeof(*new));
|
||||
struct entry *new = xcalloc(1, sizeof(struct entry));
|
||||
memcpy(new->old_sha1, sha1, 20);
|
||||
memmove(convert + pos + 1, convert + pos, (nr_convert - pos) * sizeof(struct entry *));
|
||||
convert[pos] = new;
|
||||
|
Reference in New Issue
Block a user