# [PATCH] --pretty=format: fix broken %ct and %at interpolation

2 messages from 2007-03-27 to 2007-03-27. Participants: Jeff King, Johannes Schindelin.
Thread: https://gitlist.dev/t/7440

## Jeff King, 2007-03-27 23:26

Subject: [PATCH] --pretty=format: fix broken %ct and %at interpolation
Message-ID: <20070327232628.GA9981@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20070327232628.GA9981%40coredump.intra.peff.net

```
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>
---
 commit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/commit.c b/commit.c
index 718e568..a92958c 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++)
-- 
1.5.1.rc2.618.g98453b

```

## Johannes Schindelin, 2007-03-27 23:42

Subject: Re: [PATCH] --pretty=format: fix broken %ct and %at interpolation
Message-ID: <Pine.LNX.4.63.0703280142230.4045@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0703280142230.4045%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <20070327232628.GA9981@coredump.intra.peff.net>

```
Hi,

On Tue, 27 Mar 2007, Jeff King wrote:

> A pointer arithmetic error in fill_person caused random data
> from the commit object to be included with the timestamp,

Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

```
