Skip to content

Commit

Permalink
Merge branch 'jk/apply-similaritly-parsing' into maint
Browse files Browse the repository at this point in the history
* jk/apply-similaritly-parsing:
  builtin/apply: tighten (dis)similarity index parsing
  • Loading branch information
Junio C Hamano committed Feb 25, 2013
2 parents 7be0931 + afcb6ac commit 66d12f9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions builtin/apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -1041,15 +1041,17 @@ static int gitdiff_renamedst(const char *line, struct patch *patch)

static int gitdiff_similarity(const char *line, struct patch *patch)
{
if ((patch->score = strtoul(line, NULL, 10)) == ULONG_MAX)
patch->score = 0;
unsigned long val = strtoul(line, NULL, 10);
if (val <= 100)
patch->score = val;
return 0;
}

static int gitdiff_dissimilarity(const char *line, struct patch *patch)
{
if ((patch->score = strtoul(line, NULL, 10)) == ULONG_MAX)
patch->score = 0;
unsigned long val = strtoul(line, NULL, 10);
if (val <= 100)
patch->score = val;
return 0;
}

Expand Down

0 comments on commit 66d12f9

Please sign in to comment.