diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2017-03-26 16:01:25 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-26 22:08:21 -0700 |
commit | cd02599c480570484ec0a38a5bf66ac69ee3dd19 (patch) | |
tree | d3c301f3e0be64d16704399d36fe18019dc64a38 /builtin/patch-id.c | |
parent | dc01505f7f272a44b974e622f75bd592debe9dcb (diff) | |
download | git-cd02599c480570484ec0a38a5bf66ac69ee3dd19.tar.gz |
Convert GIT_SHA1_RAWSZ used for allocation to GIT_MAX_RAWSZ
Since we will likely be introducing a new hash function at some point,
and that hash function might be longer than 20 bytes, use the constant
GIT_MAX_RAWSZ, which is designed to be suitable for allocations, instead
of GIT_SHA1_RAWSZ. This will ease the transition down the line by
distinguishing between places where we need to allocate memory suitable
for the largest hash from those where we need to handle the current
hash.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/patch-id.c')
-rw-r--r-- | builtin/patch-id.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/patch-id.c b/builtin/patch-id.c index a84d0003a3..81552e02e4 100644 --- a/builtin/patch-id.c +++ b/builtin/patch-id.c @@ -55,7 +55,7 @@ static int scan_hunk_header(const char *p, int *p_before, int *p_after) static void flush_one_hunk(struct object_id *result, git_SHA_CTX *ctx) { - unsigned char hash[GIT_SHA1_RAWSZ]; + unsigned char hash[GIT_MAX_RAWSZ]; unsigned short carry = 0; int i; |