Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 42661d7

Browse files
committed
index: initialize best_len unnecessarily
gcc thinks this could be used uninitialized; cope with this.
1 parent 2fd627d commit 42661d7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/libgit2/index.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ static int canonicalize_directory_path(
12101210
{
12111211
const git_index_entry *match, *best = NULL;
12121212
char *search, *sep;
1213-
size_t pos, search_len, best_len;
1213+
size_t pos, search_len, best_len = 0;
12141214

12151215
if (!index->ignore_case)
12161216
return 0;

0 commit comments

Comments
 (0)