@matheusbsbs / matheus-bagliano / commits / 53f420ef00
Fork 0

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>

Junio C Hamano committed Apr 22, 2006 at 03:06 UTC 53f420ef00ca6cc3554084c4c9fb89f50c634f58
1 file changed +3 -2
commit.c
+3 -2
@@ -574,8 +574,9 @@ unsigned long pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit
574 }
575
576 if (subject) {
577 - memcpy(buf + offset, subject, 9);
578 - offset += 9;
577 + int slen = strlen(subject);
578 + memcpy(buf + offset, subject, slen);
579 + offset += slen;
580 }
581 memset(buf + offset, ' ', indent);
582 memcpy(buf + offset + indent, line, linelen);