Re: [PATCH 52/67] use sha1_to_hex_to() instead of strcpy
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 16, 2015, 21:51 UTC
- Message-ID
- <xmqq1tdyowxa.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20150915160535.GZ29753@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> diff --git a/builtin/merge-index.c b/builtin/merge-index.c
> index 1d66111..4ed0a83 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][60];
> + char hexbuf[4][GIT_SHA1_HEXSZ + 1];
> char ownbuf[4][60];So you saved 19*4 = 76 bytes at runtime?
Looks good ;-).