`git_hdr_len` is an `int` variable that can be negative and is used to compare against a `len` of `size_t`, which will trigger -Wsign-comparison warnings Cast `git_hdr_len` to `size_t` after an above-zero check. Signed-off-by: Zejun Zhao <jelly.zhao.42@xxxxxxxxx> --- apply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apply.c b/apply.c index b4ae74a5fb..605a0aa2e3 100644 --- a/apply.c +++ b/apply.c @@ -1592,7 +1592,7 @@ static int find_header(struct apply_state *state, size, patch); if (git_hdr_len < 0) return -128; - if (git_hdr_len <= len) + if ((size_t) git_hdr_len <= len) continue; *hdrsize = git_hdr_len; return offset; -- 2.43.0