Commits

Johannes Schindelin  committed 6e17886

git-mv: fix off-by-one error

Embarassing.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>

  • Participants
  • Parent commits c5203bd

Comments (0)

Files changed (1)

File builtin-mv.c

 		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) {