From: Ariel Badichi Date: Wed, 23 Apr 2008 01:06:27 +0000 (+0300) Subject: archive.c: format_subst - fixed bogus argument to memchr X-Git-Tag: v1.5.5.2~9^2~10 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=75b7dfbdc030cfc6f09a6317444c36c4957a9133;p=git.git archive.c: format_subst - fixed bogus argument to memchr Also removed a superfluous test. Signed-off-by: Ariel Badichi Signed-off-by: Junio C Hamano --- diff --git a/archive.c b/archive.c index fb159fe59..7a32c19d3 100644 --- a/archive.c +++ b/archive.c @@ -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;