From ee088583a3b4a0843c36b3eee75879ad93d5e5c8 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 10 Jun 2015 10:58:59 +0200 Subject: python/arfile.cc: LFS: Use long long instead of long for file sizes This should make large files in ar archives work. See Bug: #742885 --- python/arfile.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'python') diff --git a/python/arfile.cc b/python/arfile.cc index ac766f3d..d4d7eed6 100644 --- a/python/arfile.cc +++ b/python/arfile.cc @@ -233,14 +233,14 @@ static PyObject *_extract(FileFd &Fd, const ARArchive::Member *member, // Read 4 KiB from the file, until all of the file is read. Deallocated // automatically when the function returns. SPtrArray value = new char[4096]; - unsigned long size = member->Size; - unsigned long read = 4096; + unsigned long long size = member->Size; + unsigned long long read = 4096; while (size > 0) { if (size < read) read = size; if (!Fd.Read(value, read, true)) return HandleErrors(); - if (write(outfd, value, read) != (signed)read) + if (write(outfd, value, read) != (signed long long)read) return PyErr_SetFromErrnoWithFilename(PyExc_OSError, outfile); size -= read; } -- cgit v1.2.3