diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2017-03-26 16:01:24 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-26 22:08:21 -0700 |
commit | dc01505f7f272a44b974e622f75bd592debe9dcb (patch) | |
tree | 7aa62babd604067a3d928edfa988391711a36007 /builtin/merge-index.c | |
parent | Define new hash-size constants for allocating memory (diff) | |
download | tgif-dc01505f7f272a44b974e622f75bd592debe9dcb.tar.xz |
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>
Diffstat (limited to 'builtin/merge-index.c')
-rw-r--r-- | builtin/merge-index.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/merge-index.c b/builtin/merge-index.c index 2d1b6db6bd..c99443b095 100644 --- a/builtin/merge-index.c +++ b/builtin/merge-index.c @@ -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) |