Initialize size and crc upon ZIP_SOURCE_OPEN, to allow multiple read passes.
--HG--
branch : HEAD
diff --git a/lib/zip_source_crc.c b/lib/zip_source_crc.c
index e13141c..0b0634c 100644
--- a/lib/zip_source_crc.c
+++ b/lib/zip_source_crc.c
@@ -64,9 +64,6 @@
return NULL;
}
- ctx->eof = 0;
- ctx->crc = crc32(0, NULL, 0);
- ctx->size = 0;
ctx->src = src;
@@ -88,6 +85,10 @@
if (zip_source_call(ctx->src, data, len, cmd) < 0)
return -1;
+ ctx->eof = 0;
+ ctx->crc = crc32(0, NULL, 0);
+ ctx->size = 0;
+
return 0;
case ZIP_SOURCE_READ: