diff options
| author | Junio C Hamano <junkio@cox.net> | 2006-08-26 01:06:22 -0700 |
|---|---|---|
| committer | Junio C Hamano <junkio@cox.net> | 2006-08-26 01:06:22 -0700 |
| commit | a7f051987c5f020e60da1e5d6ddefc3d443d3299 (patch) | |
| tree | ad35bcb194fce5509db30e12b499920b01ccc930 /convert-objects.c | |
| parent | 030b52087f0a4b7b1178d34839868ce438eb2f0e (diff) | |
| parent | a8e0d16d85fb2ea53775f64549cac2396cd621a6 (diff) | |
| download | git-a7f051987c5f020e60da1e5d6ddefc3d443d3299.tar.gz | |
Merge branch 'gl/cleanup'
* gl/cleanup:
Convert memset(hash,0,20) to hashclr(hash).
Convert memcpy(a,b,20) to hashcpy(a,b).
Diffstat (limited to 'convert-objects.c')
| -rw-r--r-- | convert-objects.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/convert-objects.c b/convert-objects.c index 4e7ff7517f..631678b08a 100644 --- a/convert-objects.c +++ b/convert-objects.c @@ -23,7 +23,7 @@ static struct entry * convert_entry(unsigned char *sha1); static struct entry *insert_new(unsigned char *sha1, int pos) { struct entry *new = xcalloc(1, sizeof(struct entry)); - memcpy(new->old_sha1, sha1, 20); + hashcpy(new->old_sha1, sha1); memmove(convert + pos + 1, convert + pos, (nr_convert - pos) * sizeof(struct entry *)); convert[pos] = new; nr_convert++; @@ -54,7 +54,7 @@ static struct entry *lookup_entry(unsigned char *sha1) static void convert_binary_sha1(void *buffer) { struct entry *entry = convert_entry(buffer); - memcpy(buffer, entry->new_sha1, 20); + hashcpy(buffer, entry->new_sha1); } static void convert_ascii_sha1(void *buffer) @@ -104,7 +104,7 @@ static int write_subdirectory(void *buffer, unsigned long size, const char *base if (!slash) { newlen += sprintf(new + newlen, "%o %s", mode, path); new[newlen++] = '\0'; - memcpy(new + newlen, (char *) buffer + len - 20, 20); + hashcpy((unsigned char*)new + newlen, (unsigned char *) buffer + len - 20); newlen += 20; used += len; |
