DORMANTno replies

[PATCH] git-mv: fix off-by-one error

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:42:37
Subsystem: the rest · Maintainer: Linus Torvalds

Embarassing.

Signed-off-by: Johannes Schindelin <redacted>
---

	This bug made t7001-mv.sh fail with the patch in
	http://article.gmane.org/gmane.comp.version-control.git/25647
	when XMALLOC_POISON was set, which was probably the reason it
	was not yet applied...

 builtin-mv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-mv.c b/builtin-mv.c
index 6e7062b..ff882be 100644
--- a/builtin-mv.c
+++ b/builtin-mv.c
@@ -26,7 +26,7 @@ static const char **copy_pathspec(const 
 		if (length > 0 && result[i][length - 1] == '/') {
 			char *without_slash = xmalloc(length);
 			memcpy(without_slash, result[i], length - 1);
-			without_slash[length] = '\0';
+			without_slash[length - 1] = '\0';
 			result[i] = without_slash;
 		}
 		if (base_name) {
-- 
1.4.2.gc69d
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help