Skip to content

Commit

Permalink
archive.c: format_subst - fixed bogus argument to memchr
Browse files Browse the repository at this point in the history
Also removed a superfluous test.

Signed-off-by: Ariel Badichi <abadichi@bezeqint.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ariel Badichi authored and Junio C Hamano committed Apr 23, 2008
1 parent 8b1f6de commit 75b7dfb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ static void format_subst(const struct commit *commit,
const char *b, *c;

b = memmem(src, len, "$Format:", 8);
if (!b || src + len < b + 9)
if (!b)
break;
c = memchr(b + 8, '$', len - 8);
c = memchr(b + 8, '$', (src + len) - b - 8);
if (!c)
break;

Expand Down

0 comments on commit 75b7dfb

Please sign in to comment.