From 77b339f7b6c7e167ecaf9374eb6876b498d8cb83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Tue, 12 May 2015 13:06:33 +0200 Subject: odb: make the writestream's size a git_off_t Restricting files to size_t is a silly limitation. The loose backend writes to a file directly, so there is no issue in using 63 bits for the size. We still assume that the header is going to fit in 64 bytes, which does mean quite a bit smaller files due to the run-length encoding, but it's still a much larger size than you would want Git to handle. --- src/blob.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/blob.c') diff --git a/src/blob.c b/src/blob.c index 47216507b..07c4d92c8 100644 --- a/src/blob.c +++ b/src/blob.c @@ -76,10 +76,11 @@ static int write_file_stream( int fd, error; char buffer[FILEIO_BUFSIZE]; git_odb_stream *stream = NULL; - ssize_t read_len = -1, written = 0; + ssize_t read_len = -1; + git_off_t written = 0; if ((error = git_odb_open_wstream( - &stream, odb, (size_t)file_size, GIT_OBJ_BLOB)) < 0) + &stream, odb, file_size, GIT_OBJ_BLOB)) < 0) return error; if ((fd = git_futils_open_ro(path)) < 0) { -- cgit v1.2.1