From 53f420ef00ca6cc3554084c4c9fb89f50c634f58 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 22 Apr 2006 03:06:13 -0700 Subject: [PATCH] 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 --- commit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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);