From 61735ccf765263d07928fef078f26162aba1a187 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 28 Nov 2016 01:19:55 +0100 Subject: [PATCH] Only set locator bit if the locator is going to be added --- miniz_zip.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/miniz_zip.c b/miniz_zip.c index 76481f4..da9e177 100644 --- a/miniz_zip.c +++ b/miniz_zip.c @@ -2786,7 +2786,10 @@ mz_bool mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip, const char *pArchive_n mz_uint8 *pExtra_data = NULL; mz_uint32 extra_size = 0; mz_uint8 extra_data[MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE]; - mz_uint16 bit_flags = MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR; + mz_uint16 bit_flags = 0; + + if(uncomp_size) + bit_flags |= MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR if (level_and_flags & MZ_ZIP_FLAG_UTF8_FILENAME ) bit_flags |= MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8;