|
From: <lab...@us...> - 2019-09-02 20:05:58
|
Revision: 1596
http://sourceforge.net/p/opengtoolkit/svn/1596
Author: labviewer
Date: 2019-09-02 20:05:56 +0000 (Mon, 02 Sep 2019)
Log Message:
-----------
Update to latest state from the nmoinvaz/minizip ver 1.2 github repository
Modified Paths:
--------------
trunk/lvzip/c_source/ioapi.h
trunk/lvzip/c_source/unzip.c
trunk/lvzip/c_source/zip.c
Modified: trunk/lvzip/c_source/ioapi.h
===================================================================
--- trunk/lvzip/c_source/ioapi.h 2019-09-01 16:39:24 UTC (rev 1595)
+++ trunk/lvzip/c_source/ioapi.h 2019-09-02 20:05:56 UTC (rev 1596)
@@ -42,13 +42,8 @@
# define ftello64 ftell
# define fseeko64 fseek
#else
-# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__ANDROID__)
+# if defined(_MSC_VER)
# define fopen64 fopen
-# define ftello64 ftello
-# define fseeko64 fseeko
-# endif
-# ifdef _MSC_VER
-# define fopen64 fopen
# if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC)))
# define ftello64 _ftelli64
# define fseeko64 _fseeki64
@@ -56,6 +51,10 @@
# define ftello64 ftell
# define fseeko64 fseek
# endif
+# else
+# define fopen64 fopen
+# define ftello64 ftello
+# define fseeko64 fseeko
# endif
#endif
Modified: trunk/lvzip/c_source/unzip.c
===================================================================
--- trunk/lvzip/c_source/unzip.c 2019-09-01 16:39:24 UTC (rev 1595)
+++ trunk/lvzip/c_source/unzip.c 2019-09-02 20:05:56 UTC (rev 1596)
@@ -1251,8 +1251,7 @@
#endif
{
int i;
- int8_t actual;
- uint8_t expected;
+ uint8_t actual, expected;
s->pcrc_32_tab = (const z_crc_t*)get_crc_table();
init_keys(password, s->keys, s->pcrc_32_tab);
@@ -1268,7 +1267,7 @@
s->cur_file_info.crc >> 24);
actual = (uint8_t)source[11];
- if (expected != actual) {
+ if ((actual != 0) && (expected != actual)) {
return UNZ_BADPASSWORD;
}
Modified: trunk/lvzip/c_source/zip.c
===================================================================
--- trunk/lvzip/c_source/zip.c 2019-09-01 16:39:24 UTC (rev 1595)
+++ trunk/lvzip/c_source/zip.c 2019-09-02 20:05:56 UTC (rev 1596)
@@ -1520,9 +1520,8 @@
if ((zi->ci.compression_method == Z_DEFLATED) && (!zi->ci.raw))
{
+ uint32_t total_out_before = (uint32_t)zi->ci.stream.total_out;
#ifdef HAVE_APPLE_COMPRESSION
- uLong total_out_before = zi->ci.stream.total_out;
-
zi->ci.astream.src_ptr = zi->ci.stream.next_in;
zi->ci.astream.src_size = zi->ci.stream.avail_in;
zi->ci.astream.dst_ptr = zi->ci.stream.next_out;
@@ -1533,7 +1532,7 @@
status = compression_stream_process(&zi->ci.astream, flags);
- uLong total_out_after = len - zi->ci.astream.src_size;
+ uint32_t total_out_after = len - zi->ci.astream.src_size;
zi->ci.stream.next_in = zi->ci.astream.src_ptr;
zi->ci.stream.avail_in = zi->ci.astream.src_size;
@@ -1546,7 +1545,6 @@
if (status == COMPRESSION_STATUS_ERROR)
err = ZIP_INTERNALERROR;
#else
- uint32_t total_out_before = (uint32_t)zi->ci.stream.total_out;
err = deflate(&zi->ci.stream, Z_NO_FLUSH);
zi->ci.pos_in_buffered_data += (uint32_t)(zi->ci.stream.total_out - total_out_before);
#endif
@@ -1908,7 +1906,7 @@
pos = centraldir_pos_inzip - zi->add_position_when_writting_offset;
/* Write the ZIP64 central directory header */
- if (pos >= UINT32_MAX || zi->number_entry > UINT32_MAX)
+ if (pos >= UINT32_MAX || zi->number_entry > UINT16_MAX)
{
uint64_t zip64_eocd_pos_inzip = ZTELL64(zi->z_filefunc, zi->filestream);
uint32_t zip64_datasize = 44;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|