Thread (30 messages) 30 messages, 2 authors, 2021-02-11

Re: [PATCH v2 1/5] commit: ignore additional signatures when parsing signed commits

flat view

From: SZEDER Gábor <hidden>
Date: 2021-01-12 17:04:36

On Mon, Jan 11, 2021 at 03:58:36AM +0000, brian m. carlson wrote:
quoted hunk ↗ jump to hunk
diff --git a/commit.c b/commit.c
index f128f18a9b..93faaad764 100644
--- a/commit.c
+++ b/commit.c
quoted hunk ↗ jump to hunk
@@ -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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help