[PATCH 3/3] builtin/apply: tighten (dis)similarity index parsing

2013-02-03 Thread John Keeping
This was prompted by an incorrect warning issued by clang [1], and a suggestion by Linus to restrict the range to check for values greater than INT_MAX since these will give bogus output after casting to int. In fact the (dis)similarity index is a percentage, so reject values greater than 100.

Re: [PATCH 3/3] builtin/apply: tighten (dis)similarity index parsing

2013-02-03 Thread Junio C Hamano
John Keeping j...@keeping.me.uk writes: diff --git a/builtin/apply.c b/builtin/apply.c index 6c11e8b..4745e75 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -1041,15 +1041,17 @@ static int gitdiff_renamedst(const char *line, struct patch *patch) static int