Skip to content

Commit 8b59952

Browse files
committed
Fix Linux warnings
This change fixes -Wmaybe-uninitialized and -Wdeprecated-declarations warnings on Linux builds
1 parent 19bca3d commit 8b59952

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/apply.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ static int apply_deltas(
575575
{
576576
git_strmap *removed_paths;
577577
size_t i;
578-
int error;
578+
int error = 0;
579579

580580
if (git_strmap_alloc(&removed_paths) < 0)
581581
return -1;

tests/index/crlf.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void test_index_crlf__cleanup(void)
2929

3030
if (expected_fixture.size) {
3131
cl_fixture_cleanup(expected_fixture.ptr);
32-
git_buf_free(&expected_fixture);
32+
git_buf_dispose(&expected_fixture);
3333
}
3434
}
3535

@@ -164,13 +164,13 @@ static void test_add_index(const char *safecrlf, const char *autocrlf, const cha
164164
cl_git_pass(git_path_direach(&reponame, 0, add_and_check_file, &compare_data));
165165

166166
cl_fixture_cleanup(expected_fixture.ptr);
167-
git_buf_free(&expected_fixture);
167+
git_buf_dispose(&expected_fixture);
168168

169-
git_buf_free(&attrbuf);
170-
git_buf_free(&expected_fixture);
171-
git_buf_free(&expected_dirname);
172-
git_buf_free(&sandboxname);
173-
git_buf_free(&reponame);
169+
git_buf_dispose(&attrbuf);
170+
git_buf_dispose(&expected_fixture);
171+
git_buf_dispose(&expected_dirname);
172+
git_buf_dispose(&sandboxname);
173+
git_buf_dispose(&reponame);
174174
}
175175

176176
static void set_up_workingdir(const char *name)
@@ -205,7 +205,7 @@ static void set_up_workingdir(const char *name)
205205
}
206206

207207
git__free(basename);
208-
git_buf_free(&dest_filename);
208+
git_buf_dispose(&dest_filename);
209209
}
210210
git_vector_free_deep(&contents);
211211
}

0 commit comments

Comments
 (0)