Skip to content

Commit

Permalink
git-mv: fix off-by-one error
Browse files Browse the repository at this point in the history
Embarassing.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Aug 21, 2006
1 parent c5203bd commit 6e17886
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin-mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6e17886

Please sign in to comment.