Update xlsxio_write.c

changed `#include <minizip/unzip.h>` to `#include <minizip/zip.h>`
This commit is contained in:
Brecht Sanders 2022-11-02 10:01:12 +01:00 committed by GitHub
parent 59fc5b0a0f
commit b90589e29d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,13 +15,13 @@
# ifdef USE_MINIZIP_NG
# include <mz_compat.h>
# else
# include <minizip/unzip.h>
# include <minizip/zip.h>
# endif
# if !defined(Z_DEFLATED) && defined(MZ_COMPRESS_METHOD_DEFLATE) /* support minizip2 which defines MZ_COMPRESS_METHOD_DEFLATE instead of Z_DEFLATED */
# define Z_DEFLATED MZ_COMPRESS_METHOD_DEFLATE
# endif
# define ZIPFILETYPE zipFile
#elif USE_MINIZIP_NG
#elif USE_MINIZIP_NG
# include <mz_compat.h>
# define ZIPFILETYPE zipFile
#else
@ -326,14 +326,14 @@ int zip_add_content_buffer (ZIPFILETYPE* zip, const char* filename, const char*
zip_fileinfo zipinfo;
time_t now = time(NULL);
struct tm* newtm = localtime(&now);
zipinfo.tmz_date.tm_sec = newtm->tm_sec;
zipinfo.tmz_date.tm_min = newtm->tm_min;
zipinfo.tmz_date.tm_hour = newtm->tm_hour;
zipinfo.tmz_date.tm_mday = newtm->tm_mday;
zipinfo.tmz_date.tm_mon = newtm->tm_mon;
zipinfo.tmz_date.tm_sec = newtm->tm_sec;
zipinfo.tmz_date.tm_min = newtm->tm_min;
zipinfo.tmz_date.tm_hour = newtm->tm_hour;
zipinfo.tmz_date.tm_mday = newtm->tm_mday;
zipinfo.tmz_date.tm_mon = newtm->tm_mon;
zipinfo.tmz_date.tm_year = newtm->tm_year;
zipinfo.dosDate = 0;
zipinfo.internal_fa = 0;
zipinfo.dosDate = 0;
zipinfo.internal_fa = 0;
zipinfo.external_fa = 0;
if (zipOpenNewFileInZip(zip, filename, &zipinfo, NULL, 0, NULL, 0, NULL, Z_DEFLATED, 9) != ZIP_OK) {
fprintf(stderr, "Error creating file \"%s\" inside zip file\n", filename);/////