Skip to content

Commit

Permalink
git-fmt-patch: thinkofix to show [PATCH] properly.
Browse files Browse the repository at this point in the history
Updating "subject" variable without changing the hardcoded
number of bytes to memcpy from it would not help much.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Apr 22, 2006
1 parent 91efcf6 commit 53f420e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,9 @@ unsigned long pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit
}

if (subject) {
memcpy(buf + offset, subject, 9);
offset += 9;
int slen = strlen(subject);
memcpy(buf + offset, subject, slen);
offset += slen;
}
memset(buf + offset, ' ', indent);
memcpy(buf + offset + indent, line, linelen);
Expand Down

0 comments on commit 53f420e

Please sign in to comment.