From dc01505f7f272a44b974e622f75bd592debe9dcb Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Sun, 26 Mar 2017 16:01:24 +0000 Subject: Convert GIT_SHA1_HEXSZ used for allocation to GIT_MAX_HEXSZ Since we will likely be introducing a new hash function at some point, and that hash function might be longer than 40 hex characters, use the constant GIT_MAX_HEXSZ, which is designed to be suitable for allocations, instead of GIT_SHA1_HEXSZ. 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 --- bisect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bisect.c') diff --git a/bisect.c b/bisect.c index 30808cadf..21c3e3463 100644 --- a/bisect.c +++ b/bisect.c @@ -682,7 +682,7 @@ static int is_expected_rev(const struct object_id *oid) static int bisect_checkout(const unsigned char *bisect_rev, int no_checkout) { - char bisect_rev_hex[GIT_SHA1_HEXSZ + 1]; + char bisect_rev_hex[GIT_MAX_HEXSZ + 1]; memcpy(bisect_rev_hex, sha1_to_hex(bisect_rev), GIT_SHA1_HEXSZ + 1); update_ref(NULL, "BISECT_EXPECTED_REV", bisect_rev, NULL, 0, UPDATE_REFS_DIE_ON_ERR); -- cgit v1.2.1