From: Johannes Schindelin Date: Mon, 21 Aug 2006 20:22:25 +0000 (+0200) Subject: git-mv: fix off-by-one error X-Git-Tag: v1.4.2.1~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6e17886d376ee8480cc9a8b9bc5046f2d721565f;p=git.git git-mv: fix off-by-one error Embarassing. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- 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) {