aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/downloader/gzip_downloader.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/downloader/gzip_downloader.rs')
-rw-r--r--crates/shirabe/src/downloader/gzip_downloader.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/shirabe/src/downloader/gzip_downloader.rs b/crates/shirabe/src/downloader/gzip_downloader.rs
index 4ea8f3b9..6b5f3872 100644
--- a/crates/shirabe/src/downloader/gzip_downloader.rs
+++ b/crates/shirabe/src/downloader/gzip_downloader.rs
@@ -50,14 +50,15 @@ impl GzipDownloader {
}
fn extract_using_ext(&self, file: &str, target_filepath: &str) {
- let archive_file = gzopen(file, "rb");
+ // PHP does not check the gzopen result either; gzread(false, ...) is a fatal TypeError.
+ let archive_file = gzopen(file, "rb").unwrap();
let target_file = fopen(target_filepath, "wb").unwrap();
loop {
let string = gzread(archive_file.clone(), 4096);
if string.is_empty() {
break;
}
- fwrite(&target_file, &string, Some(Platform::strlen(&string)));
+ fwrite(&target_file, &string, Some(string.len() as i64));
}
gzclose(archive_file);
fclose(&target_file);