diff options
author | Piotr Jastrzebski <haaawk@google.com> | 2014-08-19 09:01:20 +0100 |
---|---|---|
committer | Piotr Jastrzebski <haaawk@google.com> | 2014-08-19 10:58:03 +0100 |
commit | 10aa9a0e2446092ccb1a0b53438fd775427160cc (patch) | |
tree | 3e07b88b87a57f7ab74c28ddf3c063d4e5ad167a /libziparchive | |
parent | 7fb0ee0c4d3ba83ec960493e43cba9cfa7a6130f (diff) | |
download | system_core-10aa9a0e2446092ccb1a0b53438fd775427160cc.zip system_core-10aa9a0e2446092ccb1a0b53438fd775427160cc.tar.gz system_core-10aa9a0e2446092ccb1a0b53438fd775427160cc.tar.bz2 |
Cleanup ziparchive
Addressed review comments from 8e08536108d2b5a7f4f9a4b008987b54602fda18
Change-Id: If576e2d6cc5ad330a7dee66b09663e0c04ea3801
Diffstat (limited to 'libziparchive')
-rw-r--r-- | libziparchive/zip_archive.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libziparchive/zip_archive.cc b/libziparchive/zip_archive.cc index 24088bb..5f9dc8d 100644 --- a/libziparchive/zip_archive.cc +++ b/libziparchive/zip_archive.cc @@ -888,6 +888,8 @@ static int32_t FindEntry(const ZipArchive* archive, const int ent, struct IterationHandle { uint32_t position; + // We're not using vector here because this code is used in the Windows SDK + // where the STL is not available. const uint8_t* prefix; uint16_t prefix_len; ZipArchive* archive; @@ -897,13 +899,12 @@ struct IterationHandle { IterationHandle(const ZipEntryName& prefix_name) : prefix_len(prefix_name.name_length) { uint8_t* prefix_copy = new uint8_t[prefix_len]; - memcpy(reinterpret_cast<void*>(prefix_copy), prefix_name.name, - prefix_len * sizeof(uint8_t)); + memcpy(prefix_copy, prefix_name.name, prefix_len); prefix = prefix_copy; } ~IterationHandle() { - delete [] prefix; + delete[] prefix; } }; |