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:
Peter Eriksen
2006-04-03 19:30:46 +01:00
committed by Junio C Hamano
parent 8e44025925
commit 90321c106c
10 changed files with 18 additions and 37 deletions

View File

@ -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;