summaryrefslogtreecommitdiff
path: root/updater/zbin/minizip/ioapi_mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'updater/zbin/minizip/ioapi_mem.c')
-rw-r--r--updater/zbin/minizip/ioapi_mem.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/updater/zbin/minizip/ioapi_mem.c b/updater/zbin/minizip/ioapi_mem.c
index 6ac1d16..6c0bf3c 100644
--- a/updater/zbin/minizip/ioapi_mem.c
+++ b/updater/zbin/minizip/ioapi_mem.c
@@ -77,7 +77,7 @@ voidpf ZCALLBACK fopen_mem_func (opaque, filename, mode)
int mode;
{
ourmemory_t *mem = malloc(sizeof(*mem));
- if (mem==NULL)
+ if (mem == NULL)
return NULL; /* Can't allocate space, so failed */
/* Filenames are specified in the form :
@@ -86,13 +86,17 @@ voidpf ZCALLBACK fopen_mem_func (opaque, filename, mode)
* size of an int and therefore may need addressing for 64bit
* architectures
*/
- if (sscanf(filename,"%p+%x",&mem->base,&mem->size)!=2)
+#ifdef _WIN64
+ if (sscanf(filename,"%p+%I64x", &mem->base, &mem->size) != 2)
return NULL;
-
+#else
+ if (sscanf(filename,"%p+%x", &mem->base, &mem->size) != 2)
+ return NULL;
+#endif
if (mode & ZLIB_FILEFUNC_MODE_CREATE)
- mem->limit=0; /* When writing we start with 0 bytes written */
+ mem->limit = 0; /* When writing we start with 0 bytes written */
else
- mem->limit=mem->size;
+ mem->limit = mem->size;
mem->cur_offset = 0;