File tree 2 files changed +2
-3
lines changed 2 files changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ impl<R: BufRead> Read for GzDecoder<R> {
303
303
if * pos < buf. len ( ) {
304
304
* pos += read_into ( self . reader . get_mut ( ) . get_mut ( ) , & mut buf[ * pos..] ) ?;
305
305
} else {
306
- let ( crc, amt) = finish ( & buf) ;
306
+ let ( crc, amt) = finish ( buf) ;
307
307
308
308
if crc != self . reader . crc ( ) . sum ( ) || amt != self . reader . crc ( ) . amount ( ) {
309
309
self . state = GzState :: End ( Some ( mem:: take ( header) ) ) ;
Original file line number Diff line number Diff line change @@ -402,8 +402,7 @@ impl GzBuilder {
402
402
let mut header = vec ! [ 0u8 ; 10 ] ;
403
403
if let Some ( v) = extra {
404
404
flg |= FEXTRA ;
405
- header. push ( ( v. len ( ) >> 0 ) as u8 ) ;
406
- header. push ( ( v. len ( ) >> 8 ) as u8 ) ;
405
+ header. extend ( ( v. len ( ) as u16 ) . to_le_bytes ( ) ) ;
407
406
header. extend ( v) ;
408
407
}
409
408
if let Some ( filename) = filename {
You can’t perform that action at this time.
0 commit comments