Skip to content

Commit

Permalink
--pretty=format: fix broken %ct and %at interpolation
Browse files Browse the repository at this point in the history
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 c0ce981
    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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Mar 28, 2007
1 parent c6e0caa commit 4621af3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand Down

0 comments on commit 4621af3

Please sign in to comment.