Description: fix build failure with libzip 0.10
zip_fread returns signed int64 while zip_stat size is an unsigned int64.
From: Fathi Boudra <fabo@debian.org>
Bug-Debian: http://bugs.debian.org/653893
From: peter green <plugwash@p10link.net>
Bug-Debian: http://bugs.debian.org/656938
--- ideviceinstaller.orig/src/ideviceinstaller.c
+++ ideviceinstaller/src/ideviceinstaller.c
@@ -161,8 +161,8 @@
}
*buffer = malloc(zs.size);
- if (zip_fread(zfile, *buffer, zs.size) != zs.size) {
- fprintf(stderr, "ERROR: zip_fread %ld bytes from '%s'\n", zs.size, filename);
+ if (zs.size>LLONG_MAX || zip_fread(zfile, *buffer, zs.size) != (zip_int64_t)zs.size) {
+ fprintf(stderr, "ERROR: zip_fread %llu bytes from '%s'\n", (unsigned long long)(zs.size), filename);
free(*buffer);
*buffer = NULL;
zip_fclose(zfile);