Thread (20 messages) flat view 20 messages, 5 authors, 2016-06-15

Re: [PATCH] Fix git-init-db creating crap directories

From: "H. Peter Anvin" <hpa@zytor.com>
Date: 2016-06-15 22:42:06

Petr Baudis wrote:
quoted hunk ↗ jump to hunk
diff --git a/init-db.c b/init-db.c
--- a/init-db.c
+++ b/init-db.c
@@ -153,7 +153,8 @@ static void copy_templates(const char *g
 		return;
 	}
 
-	memcpy(path, git_dir, len);
+	memcpy(path, git_dir, len-1);
+	path[len] = 0;
 	copy_templates_1(path, len,
Wrong!  You're not initializing path[len-1]!

	-hpa
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help