Skip to content

Commit 37ae007

Browse files
committed
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.
1 parent 819492c commit 37ae007

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/patch_parse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static int parse_header_git_index(
198198
return -1;
199199

200200
if (git_parse_peek(&c, &ctx->parse_ctx, 0) == 0 && c == ' ') {
201-
uint16_t mode;
201+
uint16_t mode = 0;
202202

203203
git_parse_advance_chars(&ctx->parse_ctx, 1);
204204

0 commit comments

Comments
 (0)