Skip to content

Commit c0eb9cc

Browse files
committed
Merge branch 'ab/clang-lints' into maint-1.7.7
* ab/clang-lints: cast variable in call to free() in builtin/diff.c and submodule.c apply: get rid of useless x < 0 comparison on a size_t type
2 parents 3b42565 + 83838d5 commit c0eb9cc

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

builtin/apply.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,6 @@ static int fuzzy_matchlines(const char *s1, size_t n1,
250250
const char *last2 = s2 + n2 - 1;
251251
int result = 0;
252252

253-
if (n1 < 0 || n2 < 0)
254-
return 0;
255-
256253
/* ignore line endings */
257254
while ((*last1 == '\r') || (*last1 == '\n'))
258255
last1--;

builtin/diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static int builtin_diff_combined(struct rev_info *revs,
182182
hashcpy((unsigned char *)(parent + i), ent[i].item->sha1);
183183
diff_tree_combined(parent[0], parent + 1, ents - 1,
184184
revs->dense_combined_merges, revs);
185-
free(parent);
185+
free((void *)parent);
186186
return 0;
187187
}
188188

submodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ static void commit_need_pushing(struct commit *commit, struct commit_list *paren
391391
rev.diffopt.format_callback_data = needs_pushing;
392392
diff_tree_combined(commit->object.sha1, parents, n, 1, &rev);
393393

394-
free(parents);
394+
free((void *)parents);
395395
}
396396

397397
int check_submodule_needs_pushing(unsigned char new_sha1[20], const char *remotes_name)

0 commit comments

Comments
 (0)