[PATCH 2/9] Fix off by one bug in reflog messages written by builtin-fetch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We are adding a space between each argument in the sprintf above
so we must account for this as we update our position within the
reflog message and append in any remaining arguments.

Signed-off-by: Shawn O. Pearce <spearce@xxxxxxxxxxx>
---
 builtin-fetch.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-fetch.c b/builtin-fetch.c
index c8c24d2..016c6e4 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -503,7 +503,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
 	rla_offset = strlen(default_rla);
 	for (j = 1; j < argc; j++) {
 		sprintf(default_rla + rla_offset, " %s", argv[j]);
-		rla_offset += strlen(argv[j]);
+		rla_offset += strlen(argv[j]) + 1;
 	}
 
 	if (i == argc)
-- 
1.5.3.1.69.g0771

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux