From 6e17886d376ee8480cc9a8b9bc5046f2d721565f Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 21 Aug 2006 22:22:25 +0200 Subject: [PATCH] git-mv: fix off-by-one error Embarassing. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- builtin-mv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin-mv.c b/builtin-mv.c index b2ecc26f2..e3bc7a86b 100644 --- a/builtin-mv.c +++ b/builtin-mv.c @@ -26,7 +26,7 @@ static const char **copy_pathspec(const char *prefix, const char **pathspec, 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) { -- 2.26.2