diff options
| author | Julian Andres Klode <jak@debian.org> | 2015-06-10 10:58:59 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2015-06-10 22:35:38 +0200 |
| commit | ee088583a3b4a0843c36b3eee75879ad93d5e5c8 (patch) | |
| tree | b57cf6698b10ea767cffa495cfc9ac2af7eeb6d4 /python | |
| parent | e7972b4ca116f6c1e40d83988c94c162d8b99821 (diff) | |
| download | python-apt-ee088583a3b4a0843c36b3eee75879ad93d5e5c8.tar.gz | |
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
Diffstat (limited to 'python')
| -rw-r--r-- | python/arfile.cc | 6 |
1 files changed, 3 insertions, 3 deletions
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<char> 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; } |
