Skip to content

Commit 2111168

Browse files
author
Junio C Hamano
committed
GIT 1.1.5
Signed-off-by: Junio C Hamano <junkio@cox.net>
2 parents c4e804b + ca18205 commit 2111168

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

entry.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ static int write_entry(struct cache_entry *ce, const char *path, struct checkout
7070
unsigned long size;
7171
long wrote;
7272
char type[20];
73-
char target[1024];
7473

7574
new = read_sha1_file(ce->sha1, type, &size);
7675
if (!new || strcmp(type, "blob")) {
@@ -94,12 +93,10 @@ static int write_entry(struct cache_entry *ce, const char *path, struct checkout
9493
return error("git-checkout-index: unable to write file %s", path);
9594
break;
9695
case S_IFLNK:
97-
memcpy(target, new, size);
98-
target[size] = '\0';
99-
if (symlink(target, path)) {
96+
if (symlink(new, path)) {
10097
free(new);
101-
return error("git-checkout-index: unable to create symlink %s (%s)",
102-
path, strerror(errno));
98+
return error("git-checkout-index: unable to create "
99+
"symlink %s (%s)", path, strerror(errno));
103100
}
104101
free(new);
105102
break;

0 commit comments

Comments
 (0)