Move extrafield parameters to end of structure.

Don't use HAVE_WZAES, because another app or library might be using mz.h on which doesn't have HAVE_WZAES defined.
Return MZ_SUPPORT_ERROR if aes_version set, but HAVE_WZAES not defined.
Fixed some LGTM alerts. #349
This commit is contained in:
Nathan Moinvaziri 2018-11-27 09:45:09 -08:00
parent 9e9d0299f1
commit f9e344888f
3 changed files with 22 additions and 26 deletions

View file

@ -42,16 +42,15 @@ typedef struct mz_zip_file_s
int64_t disk_offset; /* relative offset of local header */
uint16_t internal_fa; /* internal file attributes */
uint32_t external_fa; /* external file attributes */
uint16_t zip64; /* zip64 extension mode */
#ifdef HAVE_WZAES
uint16_t aes_version; /* winzip aes extension if not 0 */
uint8_t aes_encryption_mode; /* winzip aes encryption mode */
#endif
const char *filename; /* filename utf8 null-terminated string */
const uint8_t *extrafield; /* extrafield data */
const char *comment; /* comment utf8 null-terminated string */
uint16_t zip64; /* zip64 extension mode */
uint16_t aes_version; /* winzip aes extension if not 0 */
uint8_t aes_encryption_mode; /* winzip aes encryption mode */
} mz_zip_file, mz_zip_entry;
/***************************************************************************/