Fix writing Zip64 EOCD, implement zip_get_error().
diff --git a/lib/zip_dirent.c b/lib/zip_dirent.c index 10ec853..59df190 100644 --- a/lib/zip_dirent.c +++ b/lib/zip_dirent.c
@@ -127,7 +127,7 @@ { zip_uint64_t offset, size; zip_string_t *comment; - zip_uint8_t buf[EOCDLEN + EOCD64LEN], *p; + zip_uint8_t buf[EOCDLEN + EOCD64LEN + EOCD64LOCLEN], *p; zip_int64_t off; zip_uint64_t i; int is_zip64; @@ -639,7 +639,7 @@ zip_uint16_t dostime, dosdate; zip_encoding_type_t com_enc, name_enc; zip_extra_field_t *ef; - zip_uint8_t ef_zip64[24], *ef_zip64_p; + zip_uint8_t ef_zip64[EFZIP64SIZE], *ef_zip64_p; int is_zip64; int is_really_zip64; zip_uint8_t buf[CDENTRYSIZE], *p;
diff --git a/lib/zip_error_get.c b/lib/zip_error_get.c index f84d3ab..f6a0fa2 100644 --- a/lib/zip_error_get.c +++ b/lib/zip_error_get.c
@@ -41,3 +41,10 @@ { _zip_error_get(&za->error, zep, sep); } + + +ZIP_EXTERN zip_error_t * +zip_get_error(zip_t *za) +{ + return &za->error; +}
diff --git a/lib/zipint.h b/lib/zipint.h index 1c89b9e..46ec3cb 100644 --- a/lib/zipint.h +++ b/lib/zipint.h
@@ -148,6 +148,7 @@ #define EOCD64LEN 56 #define CDBUFSIZE (MAXCOMLEN+EOCDLEN+EOCD64LOCLEN) #define BUFSIZE 8192 +#define EFZIP64SIZE 28 #define ZIP_CM_REPLACED_DEFAULT 65534