Re: [PATCH v2 1/5] commit: ignore additional signatures when parsing signed commits
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Jan 12, 2021, 17:03 UTC
- Message-ID
- <20210112170344.GX8396@szeder.dev>
- In-Reply-To
- <20210111035840.2437737-2-sandals@crustytoothpaste.net>
On Mon, Jan 11, 2021 at 03:58:36AM +0000, brian m. carlson wrote:
> diff --git a/commit.c b/commit.c > index f128f18a9b..93faaad764 100644 > --- a/commit.c > +++ b/commit.c
Show 10 quoted lines
> @@ -1082,23 +1087,27 @@ int remove_signature(struct strbuf *buf)
> const char *line = buf->buf;
> const char *tail = buf->buf + buf->len;
> int in_signature = 0;
> - const char *sig_start = NULL;
> - const char *sig_end = NULL;
> + struct sigbuf {
> + const char *start;
> + const char *end;
> + } sigs[2] = { 0 }, *sigp = &sigs[0];Various Clang versions issue the following warning about this initialization:
CC commit.o
commit.c:1105:16: error: suggest braces around initialization of subobject
[-Werror,-Wmissing-braces]
} sigs[2] = { 0 }, *sigp = &sigs[0];
^
{}
1 error generated.