diff --git a/src/read.rs b/src/read.rs index 54a28b06..0bd88e43 100644 --- a/src/read.rs +++ b/src/read.rs @@ -195,9 +195,9 @@ fn central_header_to_zip_file(reader: &mut R) -> ZipResult()); try!(reader.read_u32::()); let offset = try!(reader.read_u32::()) as u64; - let file_name_raw = try!(reader.read_exact(file_name_length)); - let extra_field = try!(reader.read_exact(extra_field_length)); - let file_comment_raw = try!(reader.read_exact(file_comment_length)); + let file_name_raw = try!(ReadPodExt::read_exact(reader, file_name_length)); + let extra_field = try!(ReadPodExt::read_exact(reader, extra_field_length)); + let file_comment_raw = try!(ReadPodExt::read_exact(reader, file_comment_length)); let file_name = match is_utf8 { diff --git a/src/spec.rs b/src/spec.rs index 1d21acbc..bce23f88 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -34,7 +34,7 @@ impl CentralDirectoryEnd let central_directory_size = try!(reader.read_u32::()); let central_directory_offset = try!(reader.read_u32::()); let zip_file_comment_length = try!(reader.read_u16::()) as usize; - let zip_file_comment = try!(reader.read_exact(zip_file_comment_length)); + let zip_file_comment = try!(ReadPodExt::read_exact(reader, zip_file_comment_length)); Ok(CentralDirectoryEnd {