Skip to content

Commit 6e17886

Browse files
dschoJunio C Hamano
authored andcommitted
git-mv: fix off-by-one error
Embarassing. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c5203bd commit 6e17886

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin-mv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static const char **copy_pathspec(const char *prefix, const char **pathspec,
2626
if (length > 0 && result[i][length - 1] == '/') {
2727
char *without_slash = xmalloc(length);
2828
memcpy(without_slash, result[i], length - 1);
29-
without_slash[length] = '\0';
29+
without_slash[length - 1] = '\0';
3030
result[i] = without_slash;
3131
}
3232
if (base_name) {

0 commit comments

Comments
 (0)