Commit 60cb1d10b3eb0e7966be1c40501524dc10e4c512

Vicent Marti 2011-03-05T13:56:14

Use memmove() in git__joinpath for overlapping copies Signed-off-by: Vicent Marti <tanoku@gmail.com>

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/util.c b/src/util.c
index 2f1bd22..d23ae4c 100644
--- a/src/util.c
+++ b/src/util.c
@@ -221,7 +221,7 @@ void git__joinpath_n(char *buffer_out, int count, ...)
 			continue;
 
 		len = strlen(path);
-		memcpy(buffer_out, path, len);
+		memmove(buffer_out, path, len);
 		buffer_out = buffer_out + len;
 
 		if (i < count - 1 && buffer_out[-1] != '/')