latest minishared

This commit is contained in:
Antoine Cœur
2017-08-29 13:24:50 +08:00
parent 77054d5ca5
commit dc8bf3558c
3 changed files with 9 additions and 5 deletions
+3 -1
View File
@@ -43,10 +43,12 @@ uint32_t get_file_date(const char *path, uint32_t *dos_date)
ret = 1;
}
#else
struct stat s = { 0 };
struct stat s;
struct tm *filedate = NULL;
time_t tm_t = 0;
memset(&s, 0, sizeof(s));
if (strcmp(path, "-") != 0)
{
size_t len = strlen(path);
+3 -2
View File
@@ -947,7 +947,7 @@ static int unzCheckCurrentFileCoherencyHeader(unz64_s *s, uint32_t *psize_variab
uint32_t magic = 0;
uint16_t value16 = 0;
uint32_t value32 = 0;
uint32_t flags = 0;;
uint32_t flags = 0;
uint16_t size_filename = 0;
uint16_t size_extra_field = 0;
uint16_t compression_method = 0;
@@ -1333,7 +1333,6 @@ extern int ZEXPORT unzReadCurrentFile(unzFile file, voidp buf, uint32_t len)
uint32_t bytes_not_read = 0;
uint32_t bytes_read = 0;
uint32_t total_bytes_read = 0;
uint32_t i = 0;
if (s->pfile_in_zip_read->stream.next_in != NULL)
bytes_not_read = (uint32_t)(s->pfile_in_zip_read->read_buffer + UNZ_BUFSIZE -
@@ -1384,6 +1383,8 @@ extern int ZEXPORT unzReadCurrentFile(unzFile file, voidp buf, uint32_t len)
#endif
if (s->pcrc_32_tab != NULL)
{
uint32_t i = 0;
for (i = 0; i < total_bytes_read; i++)
s->pfile_in_zip_read->read_buffer[i] =
zdecode(s->keys, s->pcrc_32_tab, s->pfile_in_zip_read->read_buffer[i]);
+3 -2
View File
@@ -1332,8 +1332,6 @@ static int zipFlushWriteBuffer(zip64_internal *zi)
uint32_t total_written = 0;
uint32_t write = 0;
uint32_t max_write = 0;
uint32_t i = 0;
uint8_t t = 0;
int err = ZIP_OK;
if ((zi->ci.flag & 1) != 0)
@@ -1347,6 +1345,9 @@ static int zipFlushWriteBuffer(zip64_internal *zi)
else
#endif
{
uint32_t i = 0;
uint8_t t = 0;
for (i = 0; i < zi->ci.pos_in_buffered_data; i++)
zi->ci.buffered_data[i] = (uint8_t)zencode(zi->ci.keys, zi->ci.pcrc_32_tab, zi->ci.buffered_data[i], t);
}