aboutsummaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2007-03-27 19:26:28 -0400
committerJunio C Hamano <junkio@cox.net>2007-03-27 17:04:26 -0700
commit4621af371686f5c787c172c285562ad997281821 (patch)
tree4d60e511ec1fbbd509f1b6adeddbd46fc437cdea /commit.c
parentc6e0caa3846f05831c1d4785ef373820c75eba2b (diff)
downloadgit-4621af371686f5c787c172c285562ad997281821.tar.gz
git-4621af371686f5c787c172c285562ad997281821.tar.xz
--pretty=format: fix broken %ct and %at interpolation
A pointer arithmetic error in fill_person caused random data from the commit object to be included with the timestamp, which looked something like: $ git-rev-list --pretty=format:%ct origin/next | head commit 98453bdb3db10db26099749bc4f2dc029bed9aa9 1174977948 -0700 Merge branch 'master' into next * master: Bisect: Use commit c0ce981f5ebfd02463ff697b2fca52c7a54b0625 1174889646 -0700 Signed-off-by: Jeff King <peff@peff.net> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commit.c b/commit.c
index 718e56885..a92958cfa 100644
--- a/commit.c
+++ b/commit.c
@@ -760,7 +760,7 @@ static void fill_person(struct interp *table, const char *msg, int len)
if (msg + start == ep)
return;
- table[5].value = xstrndup(msg + start, ep - msg + start);
+ table[5].value = xstrndup(msg + start, ep - (msg + start));
/* parse tz */
for (start = ep - msg + 1; start < len && isspace(msg[start]); start++)