summaryrefslogtreecommitdiffstats
path: root/libziparchive/zip_archive.cc
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2013-12-10 16:47:14 +0000
committerNarayan Kamath <narayan@google.com>2013-12-10 16:48:50 +0000
commit58aaf46e4d3c9f6ada086f88ecf137a9e04db2d9 (patch)
tree08174787afa6b9cf5f2c461721ba2f3e65a55789 /libziparchive/zip_archive.cc
parenteb41ad212e125aa81f09df850e0c41e11ba96043 (diff)
downloadsystem_core-58aaf46e4d3c9f6ada086f88ecf137a9e04db2d9.zip
system_core-58aaf46e4d3c9f6ada086f88ecf137a9e04db2d9.tar.gz
system_core-58aaf46e4d3c9f6ada086f88ecf137a9e04db2d9.tar.bz2
Add unit tests for libziparchive.
- Add a build rule for host tests - Add basic tests for Find / Iterate and Extract for both deflated & stored entries. - Fix an off by one error that the test uncovered. Change-Id: If72009b1ea9791d5a265829f05c32ffe1c2752c4
Diffstat (limited to 'libziparchive/zip_archive.cc')
-rw-r--r--libziparchive/zip_archive.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/libziparchive/zip_archive.cc b/libziparchive/zip_archive.cc
index b63ac79..43312b4 100644
--- a/libziparchive/zip_archive.cc
+++ b/libziparchive/zip_archive.cc
@@ -243,7 +243,7 @@ static int32_t CopyFileToFile(int fd, uint8_t* begin, const uint32_t length, uin
uint32_t count = 0;
uint64_t crc = 0;
- while (count <= length) {
+ while (count < length) {
uint32_t remaining = length - count;
// Safe conversion because kBufSize is narrow enough for a 32 bit signed