mirror of
https://git.proxmox.com/git/libgit2
synced 2025-07-03 08:53:13 +00:00
blob: Fix git_blob_create_fromfile()
This commit is contained in:
parent
a51201cc73
commit
a64bf21bbb
@ -119,9 +119,9 @@ int git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *pat
|
|||||||
ssize_t read_len;
|
ssize_t read_len;
|
||||||
|
|
||||||
if (!islnk)
|
if (!islnk)
|
||||||
read_len = gitfo_read(fd, buffer, sizeof(buffer));
|
read_len = gitfo_read(fd, buffer, (size_t)(size < sizeof(buffer) ? size : sizeof(buffer)));
|
||||||
else
|
else
|
||||||
read_len = gitfo_readlink(full_path, buffer, sizeof(buffer));
|
read_len = gitfo_readlink(full_path, buffer, (size_t)size);
|
||||||
|
|
||||||
if (read_len < 0) {
|
if (read_len < 0) {
|
||||||
if (!islnk)
|
if (!islnk)
|
||||||
|
@ -97,7 +97,7 @@ int gitfo_read(git_file fd, void *buf, size_t cnt)
|
|||||||
cnt -= r;
|
cnt -= r;
|
||||||
b += r;
|
b += r;
|
||||||
}
|
}
|
||||||
return GIT_SUCCESS;
|
return (int)(b - (char *)buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
int gitfo_write(git_file fd, void *buf, size_t cnt)
|
int gitfo_write(git_file fd, void *buf, size_t cnt)
|
||||||
|
Loading…
Reference in New Issue
Block a user