summaryrefslogtreecommitdiffstats
path: root/minzip/Zip.c
diff options
context:
space:
mode:
authorcaozhiyuan <cao.zhiyuan@zte.com.cn>2016-03-11 08:18:29 +0100
committerTao Bao <tbao@google.com>2016-03-21 18:21:03 +0100
commit2584f9c24dcc86f23775e3b6c178ab41605d6d75 (patch)
treefe047a32d72c76c21adc56dd0aefaa182bde1884 /minzip/Zip.c
parentMerge "Add include/ to the Makefile include path." (diff)
downloadandroid_bootable_recovery-2584f9c24dcc86f23775e3b6c178ab41605d6d75.tar
android_bootable_recovery-2584f9c24dcc86f23775e3b6c178ab41605d6d75.tar.gz
android_bootable_recovery-2584f9c24dcc86f23775e3b6c178ab41605d6d75.tar.bz2
android_bootable_recovery-2584f9c24dcc86f23775e3b6c178ab41605d6d75.tar.lz
android_bootable_recovery-2584f9c24dcc86f23775e3b6c178ab41605d6d75.tar.xz
android_bootable_recovery-2584f9c24dcc86f23775e3b6c178ab41605d6d75.tar.zst
android_bootable_recovery-2584f9c24dcc86f23775e3b6c178ab41605d6d75.zip
Diffstat (limited to 'minzip/Zip.c')
-rw-r--r--minzip/Zip.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/minzip/Zip.c b/minzip/Zip.c
index 38f939fb2..0f89835ca 100644
--- a/minzip/Zip.c
+++ b/minzip/Zip.c
@@ -91,7 +91,7 @@ enum {
static void dumpEntry(const ZipEntry* pEntry)
{
LOGI(" %p '%.*s'\n", pEntry->fileName,pEntry->fileNameLen,pEntry->fileName);
- LOGI(" off=%ld comp=%ld uncomp=%ld how=%d\n", pEntry->offset,
+ LOGI(" off=%u comp=%u uncomp=%u how=%d\n", pEntry->offset,
pEntry->compLen, pEntry->uncompLen, pEntry->compression);
}
#endif
@@ -505,7 +505,8 @@ static bool processDeflatedEntry(const ZipArchive *pArchive,
const ZipEntry *pEntry, ProcessZipEntryContentsFunction processFunction,
void *cookie)
{
- long result = -1;
+ bool success = false;
+ unsigned long totalOut = 0;
unsigned char procBuf[32 * 1024];
z_stream zstream;
int zerr;
@@ -569,16 +570,17 @@ static bool processDeflatedEntry(const ZipArchive *pArchive,
assert(zerr == Z_STREAM_END); /* other errors should've been caught */
// success!
- result = zstream.total_out;
+ totalOut = zstream.total_out;
+ success = true;
z_bail:
inflateEnd(&zstream); /* free up any allocated structures */
bail:
- if (result != pEntry->uncompLen) {
- if (result != -1) // error already shown?
- LOGW("Size mismatch on inflated file (%ld vs %ld)\n",
- result, pEntry->uncompLen);
+ if (totalOut != pEntry->uncompLen) {
+ if (success) { // error already shown?
+ LOGW("Size mismatch on inflated file (%lu vs %u)\n", totalOut, pEntry->uncompLen);
+ }
return false;
}
return true;