From cd02599c480570484ec0a38a5bf66ac69ee3dd19 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Sun, 26 Mar 2017 16:01:25 +0000 Subject: 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 Signed-off-by: Junio C Hamano --- patch-ids.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'patch-ids.c') diff --git a/patch-ids.c b/patch-ids.c index ce285c2e0c..fa8f11de82 100644 --- a/patch-ids.c +++ b/patch-ids.c @@ -71,7 +71,7 @@ static int init_patch_id_entry(struct patch_id *patch, struct commit *commit, struct patch_ids *ids) { - unsigned char header_only_patch_id[GIT_SHA1_RAWSZ]; + unsigned char header_only_patch_id[GIT_MAX_RAWSZ]; patch->commit = commit; if (commit_patch_id(commit, &ids->diffopts, header_only_patch_id, 1)) -- cgit v1.2.3