From: Junio C Hamano Date: Sat, 22 Apr 2006 10:06:13 +0000 (-0700) Subject: git-fmt-patch: thinkofix to show [PATCH] properly. X-Git-Tag: v1.4.1-rc1~191^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/53f420ef00ca6cc3554084c4c9fb89f50c634f58?ds=inline;hp=--cc git-fmt-patch: thinkofix to show [PATCH] properly. Updating "subject" variable without changing the hardcoded number of bytes to memcpy from it would not help much. Signed-off-by: Junio C Hamano --- 53f420ef00ca6cc3554084c4c9fb89f50c634f58 diff --git a/commit.c b/commit.c index 06e00987cc..f4e4eea014 100644 --- a/commit.c +++ b/commit.c @@ -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);