summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2020-09-18 10:38:45 +0200
committerPatrick Steinhardt <ps@pks.im>2020-09-18 10:38:45 +0200
commit37ae00799395637a37c306b8d1c41ae08f41acda (patch)
tree55dd80f1978180eb871927d20dc323306344b265
parent819492c15435efc4a2e7278ba72a2888692f60de (diff)
downloadlibgit2-37ae00799395637a37c306b8d1c41ae08f41acda.tar.gz
patch_parse: silence maybe-uninitialized warning
When building libgit2 with the release build type, then GCC complains about mode being potentially uninitialized. While this seems to be a false positive, let's silence this warning by zero-initializing the mode.
-rw-r--r--src/patch_parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/patch_parse.c b/src/patch_parse.c
index 918575306..f65b1087d 100644
--- a/src/patch_parse.c
+++ b/src/patch_parse.c
@@ -198,7 +198,7 @@ static int parse_header_git_index(
return -1;
if (git_parse_peek(&c, &ctx->parse_ctx, 0) == 0 && c == ' ') {
- uint16_t mode;
+ uint16_t mode = 0;
git_parse_advance_chars(&ctx->parse_ctx, 1);