summaryrefslogtreecommitdiff
path: root/contrib/minizip/zip.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/minizip/zip.c')
-rw-r--r--contrib/minizip/zip.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/contrib/minizip/zip.c b/contrib/minizip/zip.c
index 1a713e5..ce1444c 100644
--- a/contrib/minizip/zip.c
+++ b/contrib/minizip/zip.c
@@ -1,7 +1,7 @@
1/* zip.c -- IO on .zip files using zlib 1/* zip.c -- IO on .zip files using zlib
2 Version 1.00, September 10th, 2003 2 Version 1.01, May 8th, 2004
3 3
4 Copyright (C) 1998-2003 Gilles Vollant 4 Copyright (C) 1998-2004 Gilles Vollant
5 5
6 Read zip.h for more info 6 Read zip.h for more info
7*/ 7*/
@@ -77,7 +77,7 @@
77#endif 77#endif
78#endif 78#endif
79const char zip_copyright[] = 79const char zip_copyright[] =
80 " zip 1.00 Copyright 1998-2003 Gilles Vollant - http://www.winimage.com/zLibDll"; 80 " zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
81 81
82 82
83#define SIZEDATA_INDATABLOCK (4096-(4*4)) 83#define SIZEDATA_INDATABLOCK (4096-(4*4))
@@ -265,10 +265,19 @@ local int ziplocal_putValue (pzlib_filefunc_def, filestream, x, nbByte)
265{ 265{
266 unsigned char buf[4]; 266 unsigned char buf[4];
267 int n; 267 int n;
268 for (n = 0; n < nbByte; n++) { 268 for (n = 0; n < nbByte; n++)
269 {
269 buf[n] = (unsigned char)(x & 0xff); 270 buf[n] = (unsigned char)(x & 0xff);
270 x >>= 8; 271 x >>= 8;
271 } 272 }
273 if (x != 0)
274 { /* data overflow - hack for ZIP64 (X Roche) */
275 for (n = 0; n < nbByte; n++)
276 {
277 buf[n] = 0xff;
278 }
279 }
280
272 if (ZWRITE(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte) 281 if (ZWRITE(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte)
273 return ZIP_ERRNO; 282 return ZIP_ERRNO;
274 else 283 else
@@ -287,7 +296,16 @@ local void ziplocal_putValue_inmemory (dest, x, nbByte)
287 buf[n] = (unsigned char)(x & 0xff); 296 buf[n] = (unsigned char)(x & 0xff);
288 x >>= 8; 297 x >>= 8;
289 } 298 }
299
300 if (x != 0)
301 { /* data overflow - hack for ZIP64 */
302 for (n = 0; n < nbByte; n++)
303 {
304 buf[n] = 0xff;
305 }
306 }
290} 307}
308
291/****************************************************************************/ 309/****************************************************************************/
292 310
293 311