summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-04-22 10:06:13 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-04-22 10:06:13 (GMT)
commit53f420ef00ca6cc3554084c4c9fb89f50c634f58 (patch)
treeeff5820045f606d64722c500697d6b3e26d65b06
parent91efcf60653b2538b05625807293b97c07cb04f4 (diff)
downloadgit-53f420ef00ca6cc3554084c4c9fb89f50c634f58.zip
git-53f420ef00ca6cc3554084c4c9fb89f50c634f58.tar.gz
git-53f420ef00ca6cc3554084c4c9fb89f50c634f58.tar.bz2
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 <junkio@cox.net>
-rw-r--r--commit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/commit.c b/commit.c
index 06e0098..f4e4eea 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);