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 <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
5028bf628c
commit
dc01505f7f
@ -9,7 +9,7 @@ static int merge_entry(int pos, const char *path)
|
||||
{
|
||||
int found;
|
||||
const char *arguments[] = { pgm, "", "", "", path, "", "", "", NULL };
|
||||
char hexbuf[4][GIT_SHA1_HEXSZ + 1];
|
||||
char hexbuf[4][GIT_MAX_HEXSZ + 1];
|
||||
char ownbuf[4][60];
|
||||
|
||||
if (pos >= active_nr)
|
||||
|
Reference in New Issue
Block a user