From 6629655476ee346d64634579cac32377c1195dd1 Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Mon, 22 Feb 2016 19:49:38 -0800 Subject: Surpress warnings in minzip/Zip.c bootable/recovery/minzip/Zip.c:514:5: warning: Value stored to 'compRemaining' is never read compRemaining = pEntry->compLen; ^ ~~~~~~~~~~~~~~~ bootable/recovery/minzip/Zip.c:778:9: warning: Null pointer argument in call to memory copy function memcpy(p, helper->targetDir, helper->targetDirLen); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bug: 27229894 Change-Id: I0482bac3a4fcddc191783d1e5b5a83cf29fa4e85 --- minzip/Zip.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/minzip/Zip.c b/minzip/Zip.c index bdb565c64..38f939fb2 100644 --- a/minzip/Zip.c +++ b/minzip/Zip.c @@ -509,9 +509,6 @@ static bool processDeflatedEntry(const ZipArchive *pArchive, unsigned char procBuf[32 * 1024]; z_stream zstream; int zerr; - long compRemaining; - - compRemaining = pEntry->compLen; /* * Initialize the zlib stream. @@ -759,7 +756,7 @@ static const char *targetEntryPath(MzPathHelper *helper, ZipEntry *pEntry) */ needLen = helper->targetDirLen + 1 + pEntry->fileNameLen - helper->zipDirLen + 1; - if (needLen > helper->bufLen) { + if (firstTime || needLen > helper->bufLen) { char *newBuf; needLen *= 2; -- cgit v1.2.3