Use explicitly sized types in zipalign/ziptime
getLongLE would return a 64-bit number with the upper 32-bits set when
decoding a 32-bit number with the top bit set. Per the zip file format,
it was only expected to return a 32-bit number. Use explicitly sized
types so that we use the proper sizes and don't do any implicit
extensions.
Change-Id: I5a4304dc99ce5f8f17284d4ca3094ae115207a1e
diff --git a/tools/ziptime/ZipFile.h b/tools/ziptime/ZipFile.h
index 50ca923..b049e05 100644
--- a/tools/ziptime/ZipFile.h
+++ b/tools/ziptime/ZipFile.h
@@ -51,10 +51,10 @@
public:
EndOfCentralDir(void) : mTotalNumEntries(0), mCentralDirOffset(0) {}
- status_t readBuf(const unsigned char* buf, int len);
+ status_t readBuf(const uint8_t* buf, int len);
- unsigned short mTotalNumEntries;
- unsigned long mCentralDirOffset; // offset from first disk
+ uint16_t mTotalNumEntries;
+ uint32_t mCentralDirOffset; // offset from first disk
enum {
kSignature = 0x06054b50,